当前位置:首页 > 代码 > 正文

关于滚动图文新闻代码的信息

admin 发布:2022-12-19 21:45 125


本篇文章给大家谈谈滚动图文新闻代码,以及对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。

本文目录一览:

用DW制作首页的滚动图片新闻,怎么达到如下效果,求详细代码。

把5张图片(取名01到05)做好,放入images里,在body里插入

div

script type="text/javascript" src="js/flash.js"/script

/div

flash.js如下:

var pic_width=450; //图片宽度

var pic_height=205; //图片高度

var button_pos=4; //按扭位置 1左 2右 3上 4下

var stop_time=4000; //图片停留时间(1000为1秒钟)

var show_text=0; //是否显示文字标签 1显示 0不显示

var txtcolor="000000"; //文字色

var bgcolor="DDDDDD"; //背景色

var imag=new Array();

var link=new Array();

var text=new Array();

imag[1]="images/01.jpg";

link[1]="index-welcome.html";

text[1]="标题 1";

imag[2]="images/02.jpg";

link[2]="index-welcome.html";

text[2]="标题 2";

imag[3]="images/03.jpg";

link[3]="index-welcome.html";

text[3]="标题 3";

imag[4]="images/04.jpg";

link[4]="index-welcome.html";

text[4]="标题 4";

imag[5]="images/05.jpg";

link[2]="index-welcome.html";

text[5]="标题 5";

//可编辑内容结束

var swf_height=show_text==1?pic_height+20:pic_height;

var pics="", links="", texts="";

for(var i=1; iimag.length; i++){

pics=pics+("|"+imag[i]);

links=links+("|"+link[i]);

texts=texts+("|"+text[i]);

}

pics=pics.substring(1);

links=links.substring(1);

texts=texts.substring(1);

document.write('object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="" width="'+ pic_width +'" height="'+ swf_height +'"');

document.write('param name="movie" value="flash/focus.swf"');

document.write('param name="quality" value="high"param name="wmode" value="opaque"');

document.write('param name="FlashVars" value="pics='+pics+'links='+links+'texts='+texts+'pic_width='+pic_width+'pic_height='+pic_height+'show_text='+show_text+'txtcolor='+txtcolor+'bgcolor='+bgcolor+'button_pos='+button_pos+'stop_time='+stop_time+'"');

document.write('embed src="flash/focus.swf" FlashVars="pics='+pics+'links='+links+'texts='+texts+'pic_width='+pic_width+'pic_height='+pic_height+'show_text='+show_text+'txtcolor='+txtcolor+'bgcolor='+bgcolor+'button_pos='+button_pos+'stop_time='+stop_time+'" quality="high" width="'+ pic_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="" /');

document.write('/object');// JavaScript Document

图片滚动代码

Center

table width="1024" border="0"

tr

td height="200"DIV id=demo style="OVERFLOW: hidden; WIDTH:1024px; HEIGHT: 200px"

align="center"

TABLE cellSpacing=0 cellPadding=0 align=left border=0 cellspace="0"

TBODY

TR

TD id=demo1 vAlign=top

table width="1024" border="0" align="center" cellpadding="0" cellspacing="0"

tr

td width="250"

img src="images/book/book1.jpg" width="150" height="200"/td

td width="250"img src="images/book/book2.jpg" width="150" height="200"/td

td width="250"img src="images/book/book3.jpg" width="150" height="200"/td

td width="250"img src="images/book/book4.jpg" width="150" height="200"/td

td width="250"img src="images/book/lingdao.jpg" width="150" height="200"/td

td width="250"img src="images/book/shiya.jpg" width="150" height="200"/td

td width="250"img src="images/book/leshi.jpg" width="150" height="200"/td

td width="250"img src="images/book/hei.jpg" width="150" height="200"/td

td width="250"img src="images/book/riben.jpg" width="150" height="200"/td

td width="250"img src="images/book/xiaoyoushang.jpg" width="150" height="200"/td

td width="250"img src="images/book/siwei.jpg" width="150" height="200"/td

/table /TD

TD id=demo2 vAlign=top/TD/TR/TBODY

/TABLE

/DIV

div align="center"

SCRIPT

var speed=1

demo2.innerHTML=demo1.innerHTML

function Marquee(){

if(demo2.offsetWidth-demo.scrollLeft=0)

demo.scrollLeft-=demo1.offsetWidth

else{

demo.scrollLeft++

}

}

var MyMar=setInterval(Marquee,speed)

demo.onmouseover=function() {clearInterval(MyMar)}

demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}

/SCRIPT

/div

/td

/tr

/table

/Center

Html中实现滚动新闻无间隔限制的代码如何写,比如上下滚动是首尾相接。

你说的是不是走马灯的效果?直接在html的页面写的是用marque标签来写的,例如你说的新闻由上至下的滚动,其写法是:divmarquee

direction=top

onmouseover="this.stop()"

onmouseout="this.start()"

behavior=scroll至上而下/marquee/div

关于滚动图文新闻代码和的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。

版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;

本文地址:http://ahzz.com.cn/post/25824.html


取消回复欢迎 发表评论:

分享到

温馨提示

下载成功了么?或者链接失效了?

联系我们反馈

立即下载