代码简介:
来自腾讯网商品滚动特效,引用了远程的图片和文字 ,请下载到本地,总之效果还是不错的,美观,占用位置少。布局灵活。
代码内容:
View Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>JS+CSS防腾讯网商品滚动效果代码 - www.webdm.cn</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE>BODY {
FONT-SIZE: 12px; LINE-HEIGHT: 20px
}
TABLE {
FONT-SIZE: 12px; LINE-HEIGHT: 20px
}
.fcorg {
COLOR: #f60
}
.l000 {
COLOR: #000
}
A.l000:link {
COLOR: #000
}
A.l000:visited {
COLOR: #000
}
</STYLE>
<TABLE cellSpacing=0 cellPadding=0 width=285 border=0>
<TBODY>
<TR>
<TD align=middle width=20><IMG onMouseOver="moveThis('left')"
style="CURSOR: pointer" onmouseout=moveout() height=30
src="http://www.webdm.cn/images/20091005/6637716.gif" width=8></TD>
<TD>
<DIV id=demo
style="OVERFLOW: hidden; WIDTH: 255px; HEIGHT: 78px">
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD id=demo1>
<TABLE id=demo3 style="MARGIN-LEFT: 0px" cellSpacing=0
cellPadding=0 width=459 border=0>
<TBODY>
<TR>
<TD align=middle width=51><A
href="/"
target=_blank><IMG height=40
src="http://www.webdm.cn/images/20091005/mobile_0904.gif" width=44
border=0></A></TD>
<TD align=middle width=51><A
href="http://digital.paipai.com/sale/summer?ADTAG=346.2.1"
target=_blank><IMG height=38 src="http://www.webdm.cn/images/20091005/070417_mp3.gif" width=38
border=0></A></TD>
<TD align=middle width=51><A
href="http://game.paipai.com/sale/yz/electric_d.shtml?ADTAG=112.20.3"
target=_blank><IMG height=38 src="http://www.webdm.cn/images/20091005/071019game1.gif" width=37
border=0></A></TD>
<TD align=middle width=51><A
href="http://game.paipai.com/?ADTAG=112.20.4"
target=_blank><IMG height=38 src="http://www.webdm.cn/images/20091005/20070404_img9_4.gif" width=37
border=0></A></TD>
<TD align=middle width=51><A
href="http://lady.paipai.com/?ADTAG=112.20.5"
target=_blank><IMG height=38 src="http://www.webdm.cn/images/20091005/20070404_img9_6.gif" width=38
border=0></A></TD>
<TD align=middle width=51><A
href="#"
target=_blank><IMG height=38 src="http://www.webdm.cn/images/20091005/071019game2.gif" width=37
border=0></A></TD>
<TD align=middle width=51><A
href="http://sports.paipai.com/?ADTAG=112.20.8"
target=_blank><IMG height=38 src="http://www.webdm.cn/images/20091005/070913_2.gif" width=37
border=0></A></TD>
<TD align=middle width=51><A
href="http://sports.paipai.com/?ADTAG=112.20.8"
target=_blank><IMG height=38 src="http://www.webdm.cn/images/20091005/070913_1.gif" width=32
border=0></A></TD></TR>
<TR>
<TD align=middle><A class=l000
href="http://digital.paipai.com/sale/term/?PTAG=10001.2.12"
target=_blank>手机</A><BR><SPAN
class=fcorg>6折</SPAN></TD>
<TD align=middle><A class=l000
href="http://digital.paipai.com/sale/summer?ADTAG=346.2.1"
target=_blank>MP4</A><BR><SPAN
class=fcorg>99元</SPAN></TD>
<TD align=middle><A class=l000
href="http://game.paipai.com/sale/yz/electric_d.shtml?ADTAG=112.20.3"
target=_blank>电玩</A><BR><SPAN
class=fcorg>6折</SPAN></TD>
<TD align=middle><A class=l000
href="http://game.paipai.com/?ADTAG=112.20.4"
target=_blank>网游</A><BR><SPAN
class=fcorg>5折</SPAN></TD>
<TD align=middle><A class=l000
href="http://lady.paipai.com/?ADTAG=112.20.5"
target=_blank>戒指</A><BR><SPAN
class=fcorg>38元</SPAN></TD>
<TD align=middle><A class=l000
href="#"
target=_blank>单反</A><BR><SPAN
class=fcorg>6折</SPAN></TD>
<TD align=middle><A class=l000
href="http://sports.paipai.com/?ADTAG=112.20.8"
target=_blank>足球鞋</A><BR><SPAN
class=fcorg>109元</SPAN></TD>
<TD align=middle><A class=l000
href="http://sports.paipai.com/?ADTAG=112.20.8"
target=_blank>秋装</A><BR><SPAN
class=fcorg>39元</SPAN></TD></TR></TBODY></TABLE>
</TD>
<TD id=demo2></TD></TR></TBODY></TABLE></DIV>
</TD>
<TD align=middle width=20><IMG onMouseOver="moveThis('right')"
style="CURSOR: pointer" onmouseout=moveout() height=30
src="http://www.webdm.cn/images/20091005/6637743.gif" width=8></TD></TR></TBODY></TABLE>
<SCRIPT language=javascript>
function $(v){return document.getElementById(v);}
var speed=30;
demo2.innerHTML=demo1.innerHTML;
function MarqueeL(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth;
else
demo.scrollLeft++;
}
function MarqueeR(){
if(demo2.offsetWidth-demo.scrollLeft>=255)
demo.scrollLeft+=demo1.offsetWidth;
else
demo.scrollLeft--;
}
var flag=0;
var MyMar;
//var MyMar=setInterval(MarqueeL,speed);
demo.onmouseover=function() {if(MyMar){clearInterval(MyMar)}}
//demo.onmouseout=function() {MyMar=setInterval(MarqueeR,speed)}
function moveout(way)
{
if(MyMar)
{
clearInterval(MyMar);
}
}
function moveThis(way){
if(way=='right'){
flag=1;
if(MyMar)
{
clearInterval(MyMar);
}
MyMar=setInterval(MarqueeR,speed);
}
else{
flag=0;
if(MyMar)
{
clearInterval(MyMar);
}
MyMar=setInterval(MarqueeL,speed);
}
if(flag) demo.onmouseout=function() {MyMar=setInterval(MarqueeR,speed)}
else demo.onmouseout=function() {MyMar=setInterval(MarqueeL,speed)}
}
</SCRIPT>
</BODY></HTML>
<br />
<p><a href="http://www.webdm.cn">网页代码站</a> - 最专业的网页代码下载网站 - 致力为中国站长提供有质量的网页代码!</p>
代码来自:http://www.webdm.cn/webcode/ace4d521-b8cc-4681-b98c-d69ac56065af.html
<HTML><HEAD><TITLE>JS+CSS防腾讯网商品滚动效果代码 - www.webdm.cn</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE>BODY {
FONT-SIZE: 12px; LINE-HEIGHT: 20px
}
TABLE {
FONT-SIZE: 12px; LINE-HEIGHT: 20px
}
.fcorg {
COLOR: #f60
}
.l000 {
COLOR: #000
}
A.l000:link {
COLOR: #000
}
A.l000:visited {
COLOR: #000
}
</STYLE>
<TABLE cellSpacing=0 cellPadding=0 width=285 border=0>
<TBODY>
<TR>
<TD align=middle width=20><IMG onMouseOver="moveThis('left')"
style="CURSOR: pointer" onmouseout=moveout() height=30
src="http://www.webdm.cn/images/20091005/6637716.gif" width=8></TD>
<TD>
<DIV id=demo
style="OVERFLOW: hidden; WIDTH: 255px; HEIGHT: 78px">
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD id=demo1>
<TABLE id=demo3 style="MARGIN-LEFT: 0px" cellSpacing=0
cellPadding=0 width=459 border=0>
<TBODY>
<TR>
<TD align=middle width=51><A
href="/"
target=_blank><IMG height=40
src="http://www.webdm.cn/images/20091005/mobile_0904.gif" width=44
border=0></A></TD>
<TD align=middle width=51><A
href="http://digital.paipai.com/sale/summer?ADTAG=346.2.1"
target=_blank><IMG height=38 src="http://www.webdm.cn/images/20091005/070417_mp3.gif" width=38
border=0></A></TD>
<TD align=middle width=51><A
href="http://game.paipai.com/sale/yz/electric_d.shtml?ADTAG=112.20.3"
target=_blank><IMG height=38 src="http://www.webdm.cn/images/20091005/071019game1.gif" width=37
border=0></A></TD>
<TD align=middle width=51><A
href="http://game.paipai.com/?ADTAG=112.20.4"
target=_blank><IMG height=38 src="http://www.webdm.cn/images/20091005/20070404_img9_4.gif" width=37
border=0></A></TD>
<TD align=middle width=51><A
href="http://lady.paipai.com/?ADTAG=112.20.5"
target=_blank><IMG height=38 src="http://www.webdm.cn/images/20091005/20070404_img9_6.gif" width=38
border=0></A></TD>
<TD align=middle width=51><A
href="#"
target=_blank><IMG height=38 src="http://www.webdm.cn/images/20091005/071019game2.gif" width=37
border=0></A></TD>
<TD align=middle width=51><A
href="http://sports.paipai.com/?ADTAG=112.20.8"
target=_blank><IMG height=38 src="http://www.webdm.cn/images/20091005/070913_2.gif" width=37
border=0></A></TD>
<TD align=middle width=51><A
href="http://sports.paipai.com/?ADTAG=112.20.8"
target=_blank><IMG height=38 src="http://www.webdm.cn/images/20091005/070913_1.gif" width=32
border=0></A></TD></TR>
<TR>
<TD align=middle><A class=l000
href="http://digital.paipai.com/sale/term/?PTAG=10001.2.12"
target=_blank>手机</A><BR><SPAN
class=fcorg>6折</SPAN></TD>
<TD align=middle><A class=l000
href="http://digital.paipai.com/sale/summer?ADTAG=346.2.1"
target=_blank>MP4</A><BR><SPAN
class=fcorg>99元</SPAN></TD>
<TD align=middle><A class=l000
href="http://game.paipai.com/sale/yz/electric_d.shtml?ADTAG=112.20.3"
target=_blank>电玩</A><BR><SPAN
class=fcorg>6折</SPAN></TD>
<TD align=middle><A class=l000
href="http://game.paipai.com/?ADTAG=112.20.4"
target=_blank>网游</A><BR><SPAN
class=fcorg>5折</SPAN></TD>
<TD align=middle><A class=l000
href="http://lady.paipai.com/?ADTAG=112.20.5"
target=_blank>戒指</A><BR><SPAN
class=fcorg>38元</SPAN></TD>
<TD align=middle><A class=l000
href="#"
target=_blank>单反</A><BR><SPAN
class=fcorg>6折</SPAN></TD>
<TD align=middle><A class=l000
href="http://sports.paipai.com/?ADTAG=112.20.8"
target=_blank>足球鞋</A><BR><SPAN
class=fcorg>109元</SPAN></TD>
<TD align=middle><A class=l000
href="http://sports.paipai.com/?ADTAG=112.20.8"
target=_blank>秋装</A><BR><SPAN
class=fcorg>39元</SPAN></TD></TR></TBODY></TABLE>
</TD>
<TD id=demo2></TD></TR></TBODY></TABLE></DIV>
</TD>
<TD align=middle width=20><IMG onMouseOver="moveThis('right')"
style="CURSOR: pointer" onmouseout=moveout() height=30
src="http://www.webdm.cn/images/20091005/6637743.gif" width=8></TD></TR></TBODY></TABLE>
<SCRIPT language=javascript>
function $(v){return document.getElementById(v);}
var speed=30;
demo2.innerHTML=demo1.innerHTML;
function MarqueeL(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth;
else
demo.scrollLeft++;
}
function MarqueeR(){
if(demo2.offsetWidth-demo.scrollLeft>=255)
demo.scrollLeft+=demo1.offsetWidth;
else
demo.scrollLeft--;
}
var flag=0;
var MyMar;
//var MyMar=setInterval(MarqueeL,speed);
demo.onmouseover=function() {if(MyMar){clearInterval(MyMar)}}
//demo.onmouseout=function() {MyMar=setInterval(MarqueeR,speed)}
function moveout(way)
{
if(MyMar)
{
clearInterval(MyMar);
}
}
function moveThis(way){
if(way=='right'){
flag=1;
if(MyMar)
{
clearInterval(MyMar);
}
MyMar=setInterval(MarqueeR,speed);
}
else{
flag=0;
if(MyMar)
{
clearInterval(MyMar);
}
MyMar=setInterval(MarqueeL,speed);
}
if(flag) demo.onmouseout=function() {MyMar=setInterval(MarqueeR,speed)}
else demo.onmouseout=function() {MyMar=setInterval(MarqueeL,speed)}
}
</SCRIPT>
</BODY></HTML>
<br />
<p><a href="http://www.webdm.cn">网页代码站</a> - 最专业的网页代码下载网站 - 致力为中国站长提供有质量的网页代码!</p>
代码来自:http://www.webdm.cn/webcode/ace4d521-b8cc-4681-b98c-d69ac56065af.html