首页 技术 正文
技术 2022年11月20日
0 收藏 989 点赞 4,627 浏览 2592 个字

iphone照片查看器iphone照片查看器

 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>15.iphone图片查看器</title>
<meta name="author" content="Administrator" />
<style>
*{margin:0;padding:0}
#wrap{width:900px;height:600px;background:url(images/bg.png);margin:0 auto;position:relative}
#iphone{width:240px;height:361px;margin:0 auto;overflow:hidden;position: relative}
#img-frame{position:absolute}
li{list-style:none;float:left;width:240px;}
</style>
<script>
window.onload=function(){
var oWrap=document.getElementById('wrap');
var oIphone=document.getElementById('iphone');
var oIphone_ul=document.getElementsByTagName('ul')[0];
var oIphone_aLi=document.getElementsByTagName('li'); var downX=0;
var iNow=0; oIphone.style.paddingTop = (oWrap.offsetHeight - oIphone.offsetHeight)/2 +'px';
oIphone_ul.style.width = oIphone_aLi.length * oIphone_aLi[0].offsetWidth +'px'; oIphone_ul.onmousedown=function(ev){
var ev= ev || event;
downX= ev.clientX; if(oIphone_ul.setCapture) oIphone_ul.setCapture(); var disX = ev.clientX - oIphone_ul.offsetLeft; document.onmousemove=function(ev){
var ev= ev || event;
oIphone_ul.style.left = ev.clientX - disX +'px'
} document.onmouseup=function(ev){
var ev= ev || event;
document.onmousemove = document.onmouseup = null; if( ev.clientX < downX ){ if( iNow < oIphone_aLi.length-1 ) iNow++; //最后一次 不让他发生弹性运动 bb(oIphone_ul,{'left':-iNow*oIphone_aLi[0].offsetWidth});
console.log( iNow ) }else{ if( iNow!= 0 ) iNow--;//iNow 如果小于0 不让他发生弹性运动 bb(oIphone_ul,{'left':-iNow*oIphone_aLi[0].offsetWidth})
} }
return false
}
} function getStyle ( obj, attr ) { return obj.currentStyle?obj.currentStyle[attr] : getComputedStyle( obj )[attr]; }
/**多物体弹性运动框架**/
function bb(obj,json){
clearInterval(obj.timer);
obj.timer=setInterval(function(){
var iBtn = true;
for( var attr in json ){
/**代码块**/
if( !obj.iSpeed ) obj.iSpeed={};
if( !obj.iSpeed[attr] ) obj.iSpeed[attr]=0; var iTarget = json[attr];
var iCur = parseInt( getStyle( obj,attr ) ); obj.iSpeed[attr] += (iTarget - iCur)/6;
obj.iSpeed[attr] *= 0.75; if( Math.abs(obj.iSpeed[attr]) <=1 && Math.abs( iTarget - iCur )<=1 ){
obj.iSpeed[attr]=0;
obj.style[attr] = iTarget +'px'
}else{
iBtn = false;
var sNow= iCur + obj.iSpeed[attr];
if( attr =='width' || attr =='height' ){
if( sNow < 0 ) sNow =0;
}
obj.style[attr] = sNow +'px';
}
document.title = iCur +'-'+obj.iSpeed[attr];
/**代码块**/
} if( iBtn ){
clearInterval( obj.timer );
} },30)
}
</script>
<!-- Date: 2014-12-15 -->
</head>
<body>
<div id="wrap">
<div id="iphone">
<ul id="img-frame">
<li><img src="data:images/pic1.png"/></li>
<li><img src="data:images/pic2.png"/></li>
<li><img src="data:images/pic3.png"/></li>
<li><img src="data:images/pic4.png"/></li>
</ul>
</div>
</div>
</body>
</html>
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,983
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,500
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,344
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,127
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,761
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,838