请问这个是怎么做出来的?

goodmilk 2004-04-29 06:34:56
http://ent.163.com
页面里的那个头条新闻图片,过一段时间它会自动换图片,点不同的图片他会进入不同的页面。
...全文
15 4 点赞 打赏 收藏 举报
写回复
4 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
wanghr100 2004-04-29
<SCRIPT language=JavaScript>
<!-- // BannerAD
var bannerAD=new Array();
var bannerADlink=new Array();
var adNum=0;

//初始化. bannerAD[i]="图片地址"; bannerADlink[i]="连接地址".
bannerAD[0]="http://www.17u.net/uploadmpzppic/200433011238.jpg";
bannerADlink[0]="http://www.17u.net/mytongcheng/memberprofile.asp?id=1441";
bannerAD[1]="http://www.17u.net/uploadmpzppic/2004330112050.gif";
bannerADlink[1]="http://www.17u.net/mytongcheng/memberprofile.asp?id=3615";
bannerAD[2]="http://www.17u.net/uploadmpzppic/2004330132230.gif";
bannerADlink[2]="http://www.17u.net/mytongcheng/memberprofile.asp?id=2837";

var preloadedimages=new Array();
for (i=1;i<bannerAD.length;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=bannerAD[i];
}
function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
}

function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
}

function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
document.images.bannerADrotator.src=bannerAD[adNum];
playTransition();
theTimer=setTimeout("nextAd()", 5000);
}

function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}

function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
//-->
</SCRIPT>
<IMG border="1" name="bannerADrotator" height="144" src="http://www.17u.net/uploadmpzppic/200433011238.jpg"

style="FILTER: revealTrans(duration=2,transition=20)"></A><SCRIPT language="JavaScript">nextAd()</SCRIPT>
  • 打赏
  • 举报
回复
joe820302 2004-04-29
至于超连接的问题,只要记录下每张图片对应的Url。在img外面套一层a,动态的改变a.href就可以了
  • 打赏
  • 举报
回复
joe820302 2004-04-29
<HTML>
<HEAD>
<TITLE>joe</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=gb2312">
<style>
body{
background-color: #000000;
color: #ffffff;
}
</style>
</HEAD>
<SCRIPT LANGUAGE=javascript>
<!--
var words = new Array();
words[0] = "挪威的森林";
words[1] = "伍佰";
words[2] = "让我将你心儿摘下";
words[3] = "试着将它慢慢融化";
words[4] = "看我在你心中是否仍完美无暇";
words[5] = "是否依然为我丝丝牵挂";
words[6] = "依然爱我无法自拔";
words[7] = "心中是否有我未曾到过的地方啊";
words[8] = "那里湖面总是澄清";
words[9] = "那里空气充满宁静";
words[10] = "雪白明月照亮大地";
words[11] = "藏着你不愿提起的回忆";
words[12] = "你说真心总是可以从头";
words[13] = "真爱总是可以长久";
words[14] = "为何你的眼神还有孤独时的落寞";
words[15] = "是否我只是你一种寄托";
words[16] = "填满你感情的缺口";
words[17] = "心中那片森林何时能让我停留";
words[18] = "或许我 不该问";
words[19] = "让你平静的心再起涟漪";
words[20] = "只是爱你的心超出了界限";
words[21] = "我想拥有你所有一切";
words[22] = "应该是 我不该问";
words[23] = "不该让你再将往事重提";
words[24] = "只是心中枷锁该如何才能解脱";
words[25] = "作者:joe";
words[26] = "";


var family = new Array();
family[0] = "华文新魏";
family[1] = "方正姚体";
family[2] = "华文行楷";
family[3] = "方正舒体";
family[4] = "仿宋_GB2312";


var color = new Array();
color[0] = "#0000D5";
color[1] = "#00D55F";
color[2] = "#EC0505";
color[3] = "#F9099C";
color[4] = "#09F9CF";

var i = 0;
var j = 0;
var time0;
var time1;

function Animate(){
var tag = i%2;
var obj = document.all.main(tag);
var emp = document.all.main(1-tag);
if (i<words.length){
if (tag == 0){
obj.style.left = 300 + Math.random()*150;
}else{
obj.style.top = 250 + Math.random()*100;
}
obj.filters.item(0).Apply();
obj.style.color = color[Math.floor(Math.random()*color.length)];
obj.style.fontFamily = family[Math.floor(Math.random()*family.length)];
obj.filters.revealTrans.transition=Math.floor(Math.random()*22);
obj.filters.revealTrans.duration="1.0";
obj.innerHTML = words[i];
obj.filters.item(0).Play();
emp.filters.item(0).Apply();
emp.innerHTML = "";
emp.filters.item(0).Play();
i++;
time0 = window.setTimeout(Animate,3000);
}
}

function clean(obj){
obj.filters.item(0).Apply();
obj.filters.revealTrans.transition=Math.floor(Math.random()*22);
obj.innerHTML = "";
obj.filters.item(0).Play();
}

function BgChange(){
var obj = document.all.main(2);
if (j<=10){
obj.filters.item(0).Apply();
obj.filters.revealTrans.transition=Math.floor(Math.random()*22);
obj.filters.revealTrans.duration="5.0";
obj.children(0).src = "./images/"+(j+2)+".gif";
obj.filters.item(0).Play();
j++;
time1 = window.setTimeout(BgChange,10000);
}else{
j = -1;
time1 = window.setTimeout(BgChange,0);
}
}

function window.onload(){
time0 = window.setTimeout(Animate,3000);
time1 = window.setTimeout(BgChange,10000);
}

//-->
</SCRIPT>
<BODY leftmargin=0 topmargin=0>
<div id="main" align=center style="z-index:10;font-size: 16pt;filter:revealTrans();position:absolute;top:50;left:300;width:25;height:340;"></div>
<div id="main" align=center style="z-index:10;font-size: 16pt;filter:revealTrans();position:absolute;top:400;left:350;width:340;height:25;"></div>
<div id="main" align=center style="z-index:1;font-size: 16pt;filter:revealTrans();position:absolute;top:0;left:250;width:500;height:695;">
<img src="./images/1.gif" width="100" height="80">
</div>


</BODY>
</HTML>
<SCRIPT LANGUAGE=javascript>
<!--
//-->
</SCRIPT>
自己建一个images目录,里面放1.gif---12.gif
  • 打赏
  • 举报
回复
goodmilk 2004-04-29
没有
  • 打赏
  • 举报
回复
相关推荐
发帖
JavaScript
加入

8.5w+

社区成员

Web 开发 JavaScript
申请成为版主
帖子事件
创建了帖子
2004-04-29 06:34
社区公告
暂无公告