超炫JS拖拽翻页效果(左右拖拽html源码)
<head>
<title>blog</title>
<FCK: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_fckprotectedatt="%20onselectstart%3D%22return%20false%3B%22">
<script>
function id(obj){
return document.getElementById(obj);
}
var page;
var lm,mx;
var md=false;
var sh=0;
var en=false;
window.οnlοad=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].οnmοusedοwn=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].οnmοusemοve=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].οnmοuseup=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-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>东方之珠</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>啊!停不住的爱人</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>宁静温泉</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>你的样子</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>恋曲1980</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>恋曲1990</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>恋曲2000</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>亚细亚的孤儿</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>伴侣</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>童年</a></li>
</ul>
</div>
<div>
<ul>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>爱的箴言</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>爱人同志</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>思念</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>母亲</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>是否</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>牧童</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>青春舞曲</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>蒲公英</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>未来的主人翁</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>如今才是唯一</a></li>
</ul>
</div>
<div>
<ul>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>暗恋</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>弹唱词</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>飞车</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>东方之珠</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>滚滚红尘</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>光阴的故事</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.oern.cn _fcksavedurl=http://www.oern.cn>之乎者也</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>现象七十二变</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>乡愁四韵</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>穿过你的黑发我的手</a></li>
</ul>
</div>
<div>
<ul>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>大兵歌</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>歌</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>黄色面孔</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>台北红玫瑰</a></li>
<li><span>2009-4-9 12:35</span><a href=http://www.yp366.com _fcksavedurl=http://www.yp366.com>我所不能了解的事</a></li>
</ul>
</div>
</body>
</html>
转载于:https://www.cnblogs.com/guoguo521/archive/2011/03/15/zhangyongtao521.html
超炫JS拖拽翻页效果(左右拖拽html源码)相关推荐
- html制作翻页效果代码,使用原生JS实现滚轮翻页效果的示例代码
一.滚轮事件 当用户通过鼠标滚轮与页面交互.在垂直方向上滚动页面时,就会触发mousewheel事件,这个事件就是实现全屏切换效果需要用到的.在IE6, IE7, IE8, Opera 10+, Sa ...
- [存]超酷JS拖拽翻页效果
DEMO: http://www.lanrentuku.com/js/other-670.html 代码 <html> <head> <title>blog< ...
- 图书浏览界面html代码,javaScript+turn.js实现图书翻页效果实例代码
为了实现图书翻页的效果我们在网上可以看到很多教程 在这里推荐turn.js 网上的turn.js 有api 不过是英文的 很多人看起来不方便 .关于代码也是奇形怪状在这里我将详细讲解如何使用turn ...
- HTML5电子书翻页效果 代码特效+鼠标点击拖拽滑动翻页+点击书页内容放大+不支持中文
介绍 源码名称:[HTML5电子书翻页效果]代码特效+鼠标点击拖拽滑动翻页+点击书页内容放大+不支持中文 源码大小:237KB 开发语言:PHP+Mysql 操作系统:Windows,Linux 源码 ...
- 滑动翻页效果_Flutter实现3D效果,一个字,炫!
老孟的博客地址: http://laomengit.com/ Flutter 中3D效果是通过Transform组件实现的,没有变换效果的实现: class TransformDemo extends ...
- js实现html图片翻页效果,原生JS实现图片翻书效果
JS实现图片翻书效果-懒人图库 #center { LEFT: 50%; POSITION: absolute; TOP: 50% } #DHTMLBOOK { BACKGROUND: #000; L ...
- HTML css实现翻页效果,一个纯CSS3实现的酷炫翻书效果
效果细节 其实项目中的关键在于几个属性,perspective和rotate,便是透视和旋转 perspective 属性指定了观察者与z=0平面的距离,使具有三维位置变换的元素产生透视效果.z> ...
- html图片翻页效果代码,js图片翻书效果代码分享
这是一款基于javascript实现图片翻书效果代码,图片可以从左右两个方向进行切换,用户还可以自定义对应图片的标题与文字说明,是一款非常实用的图片特效源码. 七夕情人节也可以是表白的神器,放一些回忆 ...
- Java电子书平滑翻页效果_移动端页面平滑翻页的解决方案
随着近几年移动营销页的火爆,催生了一个中国式的名词「H5」.而 H5 最常见的形态就是类似幻灯片翻页效果. 我们需要制作 H5 的时候,最快的办法就是使用一些滑动插件库,如 iDangero.us 出 ...
最新文章
- ORA-01031:insufficient privileges问题解决
- mysql双机热备 读写分离_MySQL——主从复制与读写分离
- mysql中groupby会用到索引吗_mysql order by 与索引的使用
- 二级域名做SEO优化有怎样的利弊关系?
- kali linux 2.0配置更新源后apt-get update 报错
- VTK:可编程源用法实战
- gifcam使用缩小内存_Fedora 上的桌面环境内存占用测试 | Linux 中国
- 在Azure平台上使用托管卡进行身份认证
- §3—1 复式记账法 [第三章 复式记账 ]
- linux zip文件无法解压,无法解压zip文件在linux centos
- Vue引入百度地图API,添加点击地图拾取坐标并且标记和地址搜索功能
- Linux的进程优先级NI和PR到底有什么区别
- Uncaught Error: Syntax error, unrecognized expression: |117的js错误
- Drcom校园网认证系列(一) 抓包
- 如何合并多个PDF文件?这几个小妙招快来码住吧
- 克服神经网络中的灾难性遗忘(EWC):Overcoming catastrophic forgetting inneural networks
- c语言判断两个单词是否为变位词,C++变位词问题分析
- 通过各种统计方法建立理想的mlb投球前景
- 恩智浦+飞思卡尔后你需要知道的十件事
- 学习笔记50--terminate called after throwing an instance of ‘YAML::BadFile‘ what(): bad file报错踩坑