javascript 走马灯效果的链接提示 时间:2020-05-12 人气:0 走马灯效果的链接提示 鼠标放过来~ 脚本学习类网站 <script LANGUAGE="JavaScript"> window.onerror = null; var bName = navigator.appName; var bVer = parseInt(navigator.appVersion); var NS4 = (bName == "Netscape" && bVer >= 4); var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4); var NS3 = (bName == "Netscape" && bVer < 4); var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4); var scroll_length = 150; var time_length =50; var begin_pos = 200; var i; var j; if (NS4 || IE4) { if (navigator.appName == "Netscape") { layerStyleRef="layer."; layerRef="document.layers"; styleSwitch=""; }else{ layerStyleRef="layer.style."; layerRef="document.all"; styleSwitch=".style"; } } function Scroll(layerName){ if (NS4 || IE4) { if (NS4 || IE4) { if(i<(begin_pos+scroll_length)){ eval(layerRef+'["'+layerName+'"]'+ styleSwitch+'.visibility="visible"'); eval(layerRef+'["'+layerName+'"]'+ styleSwitch+'.left="'+i+'"'); i++; j++; if(i==j){ setTimeout("Scroll('"+layerName+"')",time_length);} } } } } function StopScroll(layerName) { i=begin_pos+scroll_length; eval(layerRef+'["'+layerName+'"]'+ styleSwitch+'.left="'+i+'"'); hideLayer(layerName); } function reset() { i=begin_pos; j=i; } function hideLayer(layerName){ if (NS4 || IE4) { eval(layerRef+'["'+layerName+'"]'+ styleSwitch+'.visibility="hidden"'); } } </script> [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] 加载全部内容