以下是 VANCL图片上下滑动代码 的示例演示效果:
部分效果截图:
HTML代码(index.html):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="JS代码,TAB标签,JS广告代码,JS特效代码" />
<meta name="description" content="此代码内容为VANCL图片上下滑动代码,属于站长常用代码" />
<title>VANCL图片上下滑动代码</title>
<link href="css/kpple.css" type=text/css rel=stylesheet>
<script src="js/jquery-1.2.3.pack.js" type=text/javascript></script>
<script src="js/jquery-extend-AdAdvance.js" type=text/javascript></script>
</head>
<body>
<center>
<div class=product-area>
<div class="dropList" id=lrtk>
<dl>
<dt>
<p>男士短袖休闲衬衫 单件99元起</p></dt>
<dd><a class=track href="#"
><img src="images/01.jpg"></a>
</dd>
<dt>
<p>女款衬衫 特惠价88元起</p></dt>
<dd style="DISPLAY: none"><A class=track
href="#" >
<img src="images/02.jpg"></A>
</dd>
<dt>
<p>针织衫+牛津纺衬衫两件168元</p></dt>
<dd style="DISPLAY: none"><A class=track
href="#" ><IMG src="images/03.jpg"></A>
</dd>
<dt>
<p>时尚透明鞋盒2个装 程序员设计师联盟淘宝店</p></dt>
<dd style="DISPLAY: none"><A class=track
href="#" ><IMG src="images/04.jpg"></A>
</dd>
<dt>
<p>时尚修身吊带衫 单件仅售48元</p></dt>
<dd style="DISPLAY: none"><A class=track
href="#" ><IMG src="images/05.jpg"></A>
</dd>
<dt>
<p>纤腿新丝袜打底裤 两双仅售25元</p></dt>
<dd style="DISPLAY: none"><A class=track
href="#" ><IMG src="images/06.jpg"></A>
</dd></dl>
</div>
</div>
<script type=text/javascript>$('#lrtk').AdAdvance();</script>
</center>
</body>
</html>
JS代码(jquery-extend-AdAdvance.js):
// Download by http://sc.xueit.com$.fn.extend({
AdAdvance:function(){
var listobj=this;
var objs =$('dt',this);
var view =objs.length-1;
//parseInt( Math.random()*objs.length);
objs.each(function(i){
$(this).mouseover(function(){
$('dd',listobj).hide();
$('.dropList-hover',listobj).attr("class","");
$(this).children("p").attr("class","dropList-hover");
$(this).next().show()}
)if(i!=view){
$(this).next().hide();
}
else{
$(this).next().show();
$(this).children("p").attr("class","dropList-hover");
}
}
);
}
}
);
CSS代码(kpple.css):
BODY{FONT-SIZE:12px;COLOR:#333;}
DL,DT,DD,UL,OL,LI{PADDING:0px;MARGIN:0px;}
p{PADDING:0px;MARGIN:0px;}
IMG{BORDER:0px}
A:link{COLOR:#333;TEXT-DECORATION:none}
A:visited{COLOR:#333;TEXT-DECORATION:none}
A:hover{COLOR:#a10000;TEXT-DECORATION:none}
.product-area{MARGIN:0 auto;}
.dropList{WIDTH:235px;BORDER-BOTTOM:#ebebeb 1px solid;HEIGHT:300px}
.dropList DL DT{BORDER-RIGHT:#ebebeb 1px solid;BORDER-TOP:#ebebeb 1px solid;BORDER-LEFT:#ebebeb 1px solid;WIDTH:233px;TEXT-INDENT:20px;LINE-HEIGHT:29px;BORDER-BOTTOM:#ebebeb 1px;HEIGHT:29px}
.dropList DL DT P{CURSOR:pointer;MARGIN-RIGHT:8px}
.dropList DL DT P.dropList-hover{COLOR:#a10000;MARGIN-RIGHT:7px}
.dropList DL DD{DISPLAY:none;OVERFLOW:hidden;WIDTH:235px;HEIGHT:120px}
.dropList DL DD IMG{BORDER-TOP:#ebebeb 1px solid}