69、文字链接的滚动说明

69、文字链接的滚动说明

脚本说明:

把如下代码加入<body>区域中

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

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; //The scroll length

 var time_length =50; //Scroll speed

 var begin_pos = 300; //Start position of scroll hint

 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";

 }

}

//SCROLL

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);}

 }

 }

 }

}

//STOP SCROLLING

function StopScroll(layerName)

{

i=begin_pos+scroll_length;

  eval(layerRef+'["'+layerName+'"]'+

  styleSwitch+'.left="'+i+'"');

  hideLayer(layerName);

}

function reset()

{

i=begin_pos;

j=i;

}

// HIDE HINT

function hideLayer(layerName){

 if (NS4 || IE4) {

 eval(layerRef+'["'+layerName+'"]'+

 styleSwitch+'.visibility="hidden"');

 }

 }

//  End -->

</script>

<center>

<a href="http://www.7stk.com" class="link" onmouseover="javascript:reset();Scroll('prem_hint');" onmouseout="javascript:StopScroll('prem_hint');">七色天空</a>

</center>

<div id="prem_hint" style="position:relative; visibility:hidden" class="prem_hint">

给你最大的惊喜!!!!!!!!!!!!

</div>

 

Write a comment

Comments: 1
  • #1

    csr04 (Tuesday, 01 September 2009 14:23)

    test