JS Control picture Scrolling around

Source: Internet
Author: User
<!doctype HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/ Xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> JS control picture left and right rolling </title>
<style type= "Text/css Tutorial" >
A {color: #213f71; font-size:9pt; text-decoration:none;}
a:hover {color: #eb8923;}
* Product_img_roll * *
. blk_18 {
Overflow:hidden;
Zoom:1;
font-size:12px;
border:1px solid #e3e3e3;
Background: #f3f3f3;
width:692px;
margin-top:8px;
}
. blk_18. Pcont {
width:638px;
Float:left;
Overflow:hidden;
padding-left:5px;
}
. blk_18. Scrcont {
width:32766px;
Zoom:1;
margin-left:-5px;
}
. blk_18 #list1_1,. blk_18 #list2_1 {
Float:left;
}
. blk_18. Leftbotton. blk_18. Rightbotton {
width:15px;
height:74px;
Float:left;
Background:url (/guendongtupian/picr_1_01.gif) no-repeat;
}
. blk_18. Leftbotton {
background-position:0 0;
margin:8px 5px 0;
}
. blk_18. Rightbotton {
Background-position:0 -100px;
margin:8px 1px 10px 5px;
}
. blk_18. leftbotton:hover {
Background-position: -20px 0;
}
. blk_18. rightbotton:hover {
Background-position: -20px-100px;
}
. blk_18. pl img {
Display:block;
Cursor:pointer;
Border:none;
MARGIN:6PX Auto 1px auto;
}
. blk_18. pl {
width:105px;
border:1px solid #f3f3f3;
Float:left;
Float:left;
Text-align:center;
line-height:24px;
}
. blk_18 A.pl:hover {
border:1px solid #5dacec;
Color: #5dacec;
Background: #fff;
}
</style>
<script type= "text/web Effects" >
======================== Products and Services ==============================
Picture Scrolling list Mengjia 070927
var speed_1 = 10; Speed (ms)
var space_1 = 20; Per move (px)
var pagewidth_1 = 107 * 6; Page width
var interval_1 = 5000; Page spacing time
var fill_1 = 0; Overall shift
var movelock_1 = false;
var movetimeobj_1;
var moveway_1= "right";
var comp_1 = 0;
var autoplayobj_1=null;
function Getobj (objname) {if (document.getElementById) {return eval (' document.getElementById (' +objname+ ') ')}else{ Return eval (' document.all. ') +objname)}}
function Autoplay_1 () {clearinterval (autoplayobj_1); Autoplayobj_1=setinterval (' isl_godown_1 (); isl_stopdown_1 (); ' , Interval_1)}
function Isl_goup_1 () {if (movelock_1) return;clearinterval (autoplayobj_1); movelock_1=true;moveway_1= "left"; Movetimeobj_1=setinterval (' isl_scrup_1 (); ', speed_1);}
function Isl_stopup_1 () {if (moveway_1 = = "Right") {Return};clearinterval (movetimeobj_1); if (Getobj (' isl_cont_1 '). Scrollleft-fill_1)%pagewidth_1!=0) {comp_1=fill_1-(getobj (' isl_cont_1 '). scrollleft%pagewidth_1); Comps tutorial cr_1 ()} Else{movelock_1=false}
Autoplay_1 ()}
function Isl_scrup_1 () {if (Getobj (' isl_cont_1 '). scrollleft<=0) {getobj (' isl_cont_1 '). Scrollleft=getobj (' Isl_ Cont_1 '). Scrollleft+getobj (' List1_1 '). offsetwidth}
Getobj (' isl_cont_1 '). Scrollleft-=space_1}
function isl_godown_1 () {clearinterval (movetimeobj_1); if (movelock_1) return;clearinterval (autoplayobj_1); movelock _1=true;moveway_1= "Right"; isl_scrdown_1 (); Movetimeobj_1=setinterval (' isl_scrdown_1 () ', Speed_1)}
function isl_stopdown_1 () {if (Moveway_1 = = "Left") {Return};clearinterval (movetimeobj_1); if (Getobj (' isl_cont_1 '). Scrollleft%pagewidth_1-(fill_1>=0?fill_1:fill_1+1)!=0) {comp_1=pagewidth_1-getobj (' isl_cont_1 '). scrollleft% Pagewidth_1+fill_1;compscr_1 ()}else{movelock_1=false}
Autoplay_1 ()}
function isl_scrdown_1 () {if (Getobj (' isl_cont_1 '). Scrollleft>=getobj (' List1_1 '). ScrollWidth) {getobj (' Isl_cont _1 '). Scrollleft=getobj (' isl_cont_1 '). Scrollleft-getobj (' List1_1 '). ScrollWidth}
Getobj (' isl_cont_1 '). Scrollleft+=space_1}
function compscr_1 () {if (comp_1==0) {Movelock_1=false;return}
var num,tempspeed=speed_1,tempspace=space_1;if (Math.Abs (comp_1) <pagewidth_1/2) {Tempspace=math.round (math.abs (Comp_1/space_1)); if (tempspace<1) {tempspace=1}}
if (comp_1<0) {if (comp_1<-tempspace) {comp_1+=tempspace;num=tempspace}else{num=-comp_1;comp_1=0}
Getobj (' isl_cont_1 '). Scrollleft-=num;settimeout (' compscr_1 () ', tempspeed)}else{if (comp_1>tempspace) {comp_1-= Tempspace;num=tempspace}else{num=comp_1;comp_1=0}
Getobj (' isl_cont_1 '). Scrollleft+=num;settimeout (' compscr_1 () ', Tempspeed)}}
function Picrun_ini () {
Getobj ("List2_1"). Innerhtml=getobj ("List1_1"). innerHTML;
Getobj (' isl_cont_1 '). Scrollleft=fill_1>=0?fill_1:getobj (' List1_1 '). Scrollwidth-math.abs (Fill_1);
Getobj ("Isl_cont_1"). Onmouseo tutorial Ver=function () {clearinterval (autoplayobj_1)}
Getobj ("Isl_cont_1"). Onmouseout=function () {autoplay_1 ()}
Autoplay_1 ();
}
</script>
<body>
<!--picrotate_left start-->
<div class= "blk_18" > <a class= "Leftbotton" onmousedown= "Isl_goup_1 ()" onmouseup= "Isl_stopup_1 ()" onmouseout = "Isl_stopup_1 ()" href= "javascript:void (0);" target= "_self" ></a>
<div class= "Pcont" id= "isl_cont_1" >
<div class= "Scrcont" >
<div id= "List1_1" >
<!--piclist begin-->
<a class= "PL" href= "#" > "a </a picture >
<a class= "PL" href= "#" >
<a class= "PL" href= "#" > "three </a >
<a class= "PL" href= "#" > "four </a >
<a class= "PL" href= "#" > "five </a >
<a class= "PL" href= "#" > "six </a >
<a class= "PL" href= "#" > "seven </a >
<a class= "PL" href= "#" > "eight </a >
<a class= "PL" href= "#" > "Nine </a >
<!--piclist End-->
</div>
<div id= "List2_1" ></div>
</div>
</div>
<a class= "Rightbotton" onmousedown= "isl_godown_1 ()" onmouseup= "isl_stopdown_1 ()" onmouseout= "isl_stopdown_1 ()" href= "javascript:void (0);" target= "_self" ></a> </div>
<div class= "C" ></div>
<script type= "Text/javascript" >
<!--
Picrun_ini ()
-->
</script>
<!--Picrotate_left End-->
</body>

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.