Very cool drag paging (JS+CSS)

Source: Internet
Author: User

<title> drag pagination </title>
<meta http-equiv=content-type content= "text/html; charset=gb2312 ">
<style>
body{
border:0px;
margin:0px;
Overflow:hidden;
Background-color:transparent;
}


. 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>
<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;
}
Http://www.codefans.net
for (i=0;i<page.length;i++) {
Page[i].classname= "Page";
page[i].innerhtml+= "<span class=" Tip > "+ (i+1) +"/"+page.length+" page tip: Drag and drop pages </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 + +) < 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 + +) < 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-29 02:16</span><a href=#> Oriental Pearl </a></li>
<li><span>2009-4-29 02:16</span><a href=#> Ah! Lover </a></li>
<li><span>2009-4-29 02:16</span><a href=#> Serene Spa </a></li>
<li><span>2009-4-29 02:16</span><a href=#> you look </a></li>
<li><span>2009-4-29 02:16</span><a href=#> Love Song 1980</a></li>
<li><span>2009-4-29 02:16</span><a href=#> Love Song 1980</a></li>
<li><span>2009-4-29 02:16</span><a href=#> Love Song 2000</a></li>
&LT;LI&GT;&LT;SPAN&GT;2009-4-29 02:16</span><a href=#> Asia's orphan </a></li>
<li><span>2009-4-29 02:16</span><a href=#> Childhood </a></li>
</ul>
</div>
<div>
<ul>


<li><span>2009-4-29 02:16</span><a href=#> Bomb lyrics </a></li>
<li><span>2009-4-29 02:16</span><a href=#> Rook </a></li>
<li><span>2009-4-29 02:16</span><a href=#> Oriental Pearl </a></li>
<li><span>2009-4-29 02:16</span><a href=#> Rolling Dust </a></li>
The story of <li><span>2009-4-29 02:16</span><a href=#> time </a></li>
<li><span>2009-4-29 02:16</span><a href=#> archaisms </a></li>
<li><span>2009-4-29 02:16</span><a href=#> Phenomenon 72 Change </a></li>
<li><span>2009-4-29 02:16</span><a href=#> Nostalgia four rhyme </a></li>
<li><span>2009-4-29 02:16</span><a href=#> through your black hair my hand </a></li>
</ul>
</div>
<div>
<ul>
<li><span>2009-4-29 02:16</span><a href=#> soldier Song </a></li>
<li><span>2009-4-29 02:16</span><a href=#> Yellow face </a></li>
<li><span>2009-4-29 02:16</span><a href=#> Taipei Red Roses </a></li>
</ul>
</div>
<div>http://www.999jiujiu.com/</div>
</body>

Very cool drag paging (JS+CSS)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.