如何在html中调用js函数
<html><head><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"><title>图...
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>图片以渐显的方式自动播放</title> <script language=javaScript> <!--// sandra0 = new Image(); sandra0.src = "/jscss/demoimg/wall_s1.jpg"; sandra1 = new Image(); sandra1.src = "/jscss/demoimg/wall_s2.jpg"; sandra2 = new Image(); sandra2.src = "/jscss/demoimg/wall_s3.jpg"; var i_strngth=1 var i_image=0 var imageurl = new Array() imageurl[0] ="/jscss/demoimg/wall_s1.jpg" imageurl[1] ="/jscss/demoimg/wall_s2.jpg" imageurl[2] ="/jscss/demoimg/wall_s3.jpg" function showimage() { if(document.all) { if (i_strngth <=110) { testimage.innerHTML="<img style='filter:alpha(opacity="+i_strngth+")' src="+imageurl[i_image]+" border=0>"; i_strngth=i_strngth+10 var timer=setTimeout("showimage()",100) } else { clearTimeout(timer) var timer=setTimeout("hideimage()",1000) } } if(document.layers) { clearTimeout(timer) document.testimage.document.write("<img src="+imageurl[i_image]+" border=0>") document.close() i_image++ if (i_image >= imageurl.length) {i_image=0} var timer=setTimeout("showimage()",2000) } } function hideimage() { if (i_strngth >=-10) { testimage.innerHTML="<img style='filter:alpha(opacity="+i_strngth+")' src="+imageurl[i_image]+" border=0>"; i_strngth=i_strngth-10 var timer=setTimeout("hideimage()",100) } else { clearTimeout(timer) i_image++ if (i_image >= imageurl.length) {i_image=0} i_strngth=1 var timer=setTimeout("showimage()",500) } } //--> </script> </head> <body> <div id="banner" style="position:absolute;visibility:visible;top:0px;left:0px"> 图片要显示在这个div下,如何操作呀? </div> </body> </html>
展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询