网页特效
建站首页
|
广告代码
|
源码下载
|
站长工具
|
字体下载
|
网页模板
|
收藏本站
|
设为首页
网站首页
菜单导航
日期时间
背景图像
图层样式
鼠标键盘
页面窗口
色彩表格
链接文字
表单按钮
计数转换
游戏娱乐
综合实例
特效
热门搜索:
特效代码
js脚本
导航菜单
热点推荐:
英文字体
人民币汇率
dw插件
站长常用软件
alexa排名查询
您的位置:
网页特效
->
鼠标键盘
-> 鼠标拖拽实现翻页
鼠标拖拽实现翻页
作者:admin 发布时间:2010-11-2 11:00:43 发布人: admin
<html> <head> <title>blog</title> <meta http-equiv="content-type" content="text/html; charset=gb2312"> <style> body{ border:0px; margin:0px; overflow:hidden; background-color:transparent; font-family:宋体; } .page{ position:absolute; width:700px; border:1px solid #999; background-color:#000; left:425px; margin-left:-350px; cursor:default; z-index:0; } ul{ height:320px; list-style:none; margin:40px 50px 0px; padding:0px; } li{ width:100%; height:30px; line-height:30px; font-size:14px; text-align:left; border-bottom:1px dashed #999; } a{ text-decoration:none; color:#999; } a:hover{ font-weight:bold; } li span{ float:right; color:#999; } .tip{ display:block; width:100%; font-size:12px; color:#999; text-align:center; margin:10px 0px 20px; } </style> </head> <body onselectstart="return false;"> <script> function id(obj){ return document.getElementById(obj); } var page; var lm,mx; var md=false; var sh=0; var en=false; window.onload=function(){ page=document.getElementsByTagName("div"); if(page.length>0){ page[0].style.zIndex=2; } for(i=0;i<page.length;i++){ page[i].className="page"; page[i].innerHTML+="<span class=tip>第 "+(i+1)+"/"+page.length+" 页 提示:左右拖拽翻页</span>"; page[i].id="page"+i; page[i].i=i; page[i].onmousedown=function(e){ if(!en){ if(!e){e=e||window.event;} lm=this.offsetLeft; mx=(e.pageX)?e.pageX:e.x; this.style.cursor="w-resize"; md=true; if(document.all){ this.setCapture(); }else{ window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP); } } } page[i].onmousemove=function(e){ if(md){ en=true; if(!e){e=e||window.event;} var ex=(e.pageX)?e.pageX:e.x; this.style.left=ex-(mx-lm)+350; if(this.offsetLeft<75){ var cu=(this.i==0)?page.length-1:this.i-1; page[sh].style.zIndex=0; page[cu].style.zIndex=1; this.style.zIndex=2; sh=cu; } if(this.offsetLeft>75){ var cu=(this.i==page.length-1)?0:this.i+1; page[sh].style.zIndex=0; page[cu].style.zIndex=1; this.style.zIndex=2; sh=cu; } } } page[i].onmouseup=function(){ this.style.cursor="default"; md=false; if(document.all){ this.releaseCapture(); }else{ window.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP); } flyout(this); } } } function flyout(obj){ if(obj.offsetLeft<75){ if( (obj.offsetLeft + 350 - 20) > -275 ){ obj.style.left=obj.offsetLeft + 350 - 20; window.setTimeout("flyout(id('"+obj.id+"'));",0); }else{ obj.style.left=-275; obj.style.zIndex=0; flyin(id(obj.id)); } } if(obj.offsetLeft>75){ if( (obj.offsetLeft + 350 + 20) < 1125 ){ obj.style.left=obj.offsetLeft + 350 + 20; window.setTimeout("flyout(id('"+obj.id+"'));",0); }else{ obj.style.left=1125; obj.style.zIndex=0; flyin(id(obj.id)); } } } function flyin(obj){ if(obj.offsetLeft<75){ if( (obj.offsetLeft + 350 + 20) < 425 ){ obj.style.left=obj.offsetLeft + 350 + 20; window.setTimeout("flyin(id('"+obj.id+"'));",0); }else{ obj.style.left=425; en=false; } } if(obj.offsetLeft>75){ if( (obj.offsetLeft + 350 - 20) > 425 ){ obj.style.left=obj.offsetLeft + 350 - 20; window.setTimeout("flyin(id('"+obj.id+"'));",0); }else{ obj.style.left=425; en=false; } } } </script> <div> <ul> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">东方之珠</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">啊!停不住的爱人</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">宁静温泉</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">你的样子</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">恋曲1980</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">恋曲1990</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">恋曲2000</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">亚细亚的孤儿</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">伴侣</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">童年</a></li> </ul> </div> <div> <ul> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">爱的箴言</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">爱人同志</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">思念</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">母亲</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">是否</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">牧童</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">青春舞曲</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">蒲公英</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">未来的主人翁</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">如今才是唯一</a></li> </ul> </div> <div> <ul> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">暗恋</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">弹唱词</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">飞车</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">东方之珠</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">滚滚红尘</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">光阴的故事</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">之乎者也</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">现象七十二变</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">乡愁四韵</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">穿过你的黑发我的手</a></li> </ul> </div> <div> <ul> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">大兵歌</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">歌</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">黄色面孔</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">台北红玫瑰</a></li> <li><span>2009-11-2 12:35</span><a href="http://web.archive.org/web/20150329085122/http://www.baidu.com/">我所不能了解的事</a></li> </ul> </div> </body> </html>
鼠标拖拽实现翻页
将本文收藏到QQ书签与更多好友分享
上一篇:文章:
纯css下拉菜单列表
下一篇:文章:
js通过封装div方式弹出div窗体
本类浏览排行 »
鼠标拖拽实现翻页
漂亮的烟花特效
实现字体大中小的另一种方法
用层模拟可移动/可隐藏的小窗口
拖动鼠标改变div层的大小宽度
让图片产生波纹一样的flash效果
不用js也能让图片固底漂浮
CSS实现图文远端链接关联效果
本站推荐文章 »
兼容ie6、ie7、ff、opera、safari的水平垂..
一款设计精美的CSS滑动门菜单
一款简洁漂亮的CSS滑动门特效
结构和表现分离的Tab选项卡特效
滑动的div层做的动态菜单
垂直三栏自适应等高布局
仿QQ消息管理器的文本内容样式
支付宝的控制台动画效果菜单