图片轮播

<link href="tzsc.css" rel="stylesheet" media="screen" type="text/css" />
<body>
<div id="touzishoucang">
	<div id="touzishoucang_le"></div>
	<div id="touzishoucang_ce">
		<div id="touzishoucang_ce_top">
			<div id="touzishoucang_ce_top_1"><img src="zyimages/huangjin_ce_top_1.jpg" width="16" height="17" border="0" /></div>
			<div id="touzishoucang_ce_top_2">投资收藏</div>
		</div>
		<div id="touzishoucang_ce_ce">
			<div class="tzscRollBox">
				<div class="LeftBotton" onmousedown="ISL_GoUp()" onmouseup="ISL_StopUp()" onmouseout="ISL_StopUp()"></div>
				<div class="Cont" id="ISL_Cont">
					<div class="ScrCont">
						<div id="List1">
							<!-- 图片列表 begin -->
							<div class="pic">
								<a href="lanmu/qixiachanpin/index.htm">
                                	<img src="zyimages/huangjin_img.jpg" width="176" height="128" border="0"/>
								</a>
								<span style="text-align:center;">
									<a href="lanmu/qixiachanpin/index.htm" style="color:#d09901">
                                    	成色AU999,规格200克/条符
                                        <br />
                                        合国家标准,天津贵金属交易认定
									</a>
								</span>
							</div> 
							<div class="pic">
								<a href="lanmu/qixiachanpin/index.htm">
                                	<img src="zyimages/huangjin_img.jpg" width="176" height="128" border="0"/>
								</a>
								<span style="text-align:center;">
                                	<a href="lanmu/qixiachanpin/index.htm" style="color:#d09901">
                                    	成色AU999,规格200克/条符
                                        <br />
                                        合国家标准,天津贵金属交易认定
                                     </a>
								</span>
							</div>       
							<!-- 图片列表 end -->
						</div>
						<div id="List2"></div>
					</div>
				</div>
				<div class="RightBotton" onmousedown="ISL_GoDown()" onmouseup="ISL_StopDown()" onmouseout="ISL_StopDown()"></div>
			</div>
		</div>
		<div id="touzishoucang_ce_fo"></div>
	</div>
	<div id="touzishoucang_ri"></div>
</div>
</body>

<script language="javascript" type="text/javascript">
<!--//--><![CDATA[//><!--
//图片滚动列表 mengjia 070816
var Speed = 1; //速度(毫秒)
var Space = 5; //每次移动(px)
var PageWidth = 176; //翻页宽度
var fill = 0; //整体移位
var MoveLock = false;
var MoveTimeObj;
var Comp = 0;
var AutoPlayObj = null;
GetObj("List2").innerHTML = GetObj("List1").innerHTML;
GetObj('ISL_Cont').scrollLeft = fill;
GetObj("ISL_Cont").onmouseover = function(){clearInterval(AutoPlayObj);}
GetObj("ISL_Cont").onmouseout = function(){AutoPlay();}
AutoPlay();
function GetObj(objName){
	if(document.getElementById){
		return eval('document.getElementById("'+objName+'")')
	}else{
		return eval('document.all.'+objName)
	}
}
function AutoPlay(){ //自动滚动
	clearInterval(AutoPlayObj);
	AutoPlayObj = setInterval('ISL_GoDown();ISL_StopDown();',3000); //间隔时间
}
function ISL_GoUp(){ //上翻开始
	if(MoveLock){
		return;
	}
	clearInterval(AutoPlayObj);
	MoveLock = true;
	MoveTimeObj = setInterval('ISL_ScrUp();',Speed);
}
function ISL_StopUp(){ //上翻停止
	clearInterval(MoveTimeObj);
	if(GetObj('ISL_Cont').scrollLeft % PageWidth - fill != 0){
		Comp = fill - (GetObj('ISL_Cont').scrollLeft % PageWidth);
		CompScr();
	}else{
		MoveLock = false;
	}
	AutoPlay();
}
function ISL_ScrUp(){ //上翻动作
	if(GetObj('ISL_Cont').scrollLeft <= 0){
		GetObj('ISL_Cont').scrollLeft = GetObj('ISL_Cont').scrollLeft + GetObj('List1').offsetWidth
	}
	GetObj('ISL_Cont').scrollLeft -= Space ;
}
function ISL_GoDown(){ //下翻
	clearInterval(MoveTimeObj);
	if(MoveLock){
		return;
	}
	clearInterval(AutoPlayObj);
	MoveLock = true;
	ISL_ScrDown();
	MoveTimeObj = setInterval('ISL_ScrDown()',Speed);
}
function ISL_StopDown(){ //下翻停止
	clearInterval(MoveTimeObj);
	if(GetObj('ISL_Cont').scrollLeft % PageWidth - fill != 0 ){
		Comp = PageWidth - GetObj('ISL_Cont').scrollLeft % PageWidth + fill;
		CompScr();
	}else{
		MoveLock = false;
	}
	AutoPlay();
}
function ISL_ScrDown(){ //下翻动作
	if(GetObj('ISL_Cont').scrollLeft >= GetObj('List1').scrollWidth){
		GetObj('ISL_Cont').scrollLeft = GetObj('ISL_Cont').scrollLeft - GetObj('List1').scrollWidth;
	}
	GetObj('ISL_Cont').scrollLeft += Space ;
}
function CompScr(){
	var num;
	if(Comp == 0){
		MoveLock = false;
		return;
	}
	if(Comp < 0){ //上翻
		if(Comp < -Space){
			Comp += Space;
			num = Space;
		}else{
			num = -Comp;
			Comp = 0;
		}
		GetObj('ISL_Cont').scrollLeft -= num;
		setTimeout('CompScr()',Speed);
	}else{ //下翻
		if(Comp > Space){
			Comp -= Space;
			num = Space;
		}else{
			num = Comp;
			Comp = 0;
		}
		GetObj('ISL_Cont').scrollLeft += num;
		setTimeout('CompScr()',Speed);
	}
}
//--><!]]>
</script>


 

 

body{
	margin:0px;
	padding:0px;
	color:#000000;
	font-family:Arial, Helvetica, sans-serif,"宋体";
	line-height:22px;
	font-size:12px;
}
a{
	text-decoration:none;
}
#touzishoucang{
	width:250px;
	height:210px;
	overflow:hidden;
	margin-top:10px;
}
#touzishoucang_le{
	width:11px;
	height:210px;
	float:left;
	background:url(zyimages/huangjin_le.jpg) no-repeat;
}
#touzishoucang_ce{
	width:230px;
	height:210px;
	overflow:hidden;
	float:left;
}
#touzishoucang_ce_top{
	width:230px;
	height:29px;
	background:url(zyimages/huangjin_ce_top.jpg) repeat-x;
}
#touzishoucang_ce_top_1{
	width:16px;
	height:17px;
	float:left;
	margin-top:5px;
}
#touzishoucang_ce_top_2{
	height:29px;
	float:left;
	line-height:29px;
	font-size:14px;
	font-weight:bold;
	color:#1b3359;
	padding-left:10px;
}
#touzishoucang_ri{
	width:9px;
	height:210px;
	float:right;
	background:url(zyimages/huangjin_ri.jpg) no-repeat;
}
#touzishoucang_ce_ce{
	width:228px;
	height:168px;
	border:1px solid #779bbf;
	overflow:hidden;
}
#touzishoucang_ce_fo{
	width:230px;
	height:11px;
	background:url(zyimages/huangjin_ce_fo.jpg) repeat-x;
}

/*--------------图片切换---------------*/
.tzscRollBox{width:228px; height:188px; overflow:hidden;}
.tzscRollBox .LeftBotton{height:39px; width:26px; background:url(zyimages/tupian_left.png) no-repeat; overflow:hidden; float:left; margin-top:56px; display:inline; cursor:pointer;}
.tzscRollBox .RightBotton{height:39px;width:26px; background:url(zyimages/tupian_right.png) no-repeat; overflow:hidden; float:left; display:inline; cursor:pointer; margin-top:56px;}
.tzscRollBox .Cont{width:176px; height:168px; overflow:hidden; float:left; margin-top:-5px;}
.tzscRollBox .ScrCont{width:10000000px;}
.tzscRollBox .Cont .pic{width:176px; height:188px; float:left; text-align:center;}
.tzscRollBox .Cont .pic img{display:block; margin-top:-10px;}
.tzscRollBox .Cont a:link,.tzscRollBox .Cont a:visited{text-decoration:none; color:3d09901;}
.tzscRollBox .Cont a span{
		color:#1d4684;
}
.tzscRollBox #List1,.tzscRollBox #List2{float:left;}


 

你可能感兴趣的:(图片轮播)