Tue

17

Mar

2009

120、鼠标右键菜单特效

120、鼠标右键菜单特效

脚本说明:

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

<style>

body,td,a {font-size:9pt;color:black}

.none{border:black 1px solid;background:D9D9D9;padding-top:2}

.over {border:black 1px solid;background:707888;color:white;padding-top:2}

</style>

<body oncontextmenu="return false">

<div style="position:absolute; left: 100; top: 100;cursor: hand;display='none';" ID=plane onmousedown="down=true;divleft=event.clientX-parseInt(plane.style.left);divtop=event.clientY-parseInt(plane.style.top)" onmouseup="down=false">

<div align=center style="position:absolute; left:150px; top:33px; width:100px; height:19px; z-index:1;color:white;background:707888;cursor:default;" class="none" onmouseover="menuin();init()">右键菜单</div>

<div align=center id="item1" style="position:absolute; left:50px; top:55px; width:99px; height:19px; z-index:2; filter:alpha(opacity=0)" onmouseover="this.className='over';menuin()"

onmouseout="this.className='none';" class="none"

><a href="http://www.7stk.com/">网页特效代码</a></div>

<div align=center id="item2" style="position:absolute; left:250px; top:77px; width:99px; height:19px; z-index:3;filter:alpha(opacity=0)"

class=none onmouseover="this.className='over';menuin()"

onmouseout="this.className='none';">身单情歌</div>

<div align=center id="item3" style="position:absolute; left:50px; top:99px; width:99px; height:19px; z-index:4; filter:alpha(opacity=0)"

class=none onmouseover="this.className='over';menuin()"

onmouseout="this.className='none';">菜单项三</div>

<div align=center id="item4" style="position:absolute; left:250px; top:121px; width:99px; height:19px; z-index:5;filter:alpha(opacity=0)"

class=none onmouseover="this.className='over';menuin()"

onmouseout="this.className='none';">菜单项四</div> <div align=center id="item5" style="position:absolute; left:50px; top:143px; width:99px; height:19px; z-index:6; filter:alpha(opacity=0)"

class=none onmouseover="this.className='over';menuin()"

onmouseout="this.className='none';">菜单项五</div>

 

</div>

<script language="vbs">

dim down,divleft,divtop,timelinestart,timelinestop,tidone,tidtwo,tidtree

down=false

timelinestart=0

timelinestop=0

sub document_onmousedown

if window.event.button=2 then

plane.style.display=""

plane.style.left=window.event.clientx-153

plane.style.top=window.event.clienty-35

end if

end sub

sub document_onmousemove

if down then

plane.style.left=window.event.clientx-divleft

plane.style.top=window.event.clienty-divtop

end if

 

end sub

sub document_ondargstart

window.event.returnvalue=false

end sub

function menuin()

cleartimeout(tidtree)

end function

sub document_onclick

tidtree=settimeout("outit()",200)

end sub

function init()

if timelinestart<>5 then

cleartimeout(tidtwo)

item1.style.pixelLeft=item1.style.pixelLeft+20

item1.filters.alpha.opacity=item1.filters.alpha.opacity+20

item2.style.pixelLeft=item2.style.pixelLeft-20

item2.filters.alpha.opacity=item2.filters.alpha.opacity+20

item3.style.pixelLeft=item3.style.pixelLeft+20

item3.filters.alpha.opacity=item3.filters.alpha.opacity+20

item4.style.pixelLeft=item4.style.pixelLeft-20

item4.filters.alpha.opacity=item4.filters.alpha.opacity+20

item5.style.pixelLeft=item5.style.pixelLeft+20

item5.filters.alpha.opacity=item5.filters.alpha.opacity+20

timelinestart=timelinestart+1

else

cleartimeout(tidone)

end if

tidone=settimeout("init()",1)

end function

function outit()

if timelinestart<>0 then

cleartimeout(tidone)

item1.style.pixelLeft=item1.style.pixelLeft-20

item1.filters.alpha.opacity=item1.filters.alpha.opacity-20

item2.style.pixelLeft=item2.style.pixelLeft+20

item2.filters.alpha.opacity=item2.filters.alpha.opacity-20

item3.style.pixelLeft=item3.style.pixelLeft-20

item3.filters.alpha.opacity=item3.filters.alpha.opacity-20

item4.style.pixelLeft=item4.style.pixelLeft+20

item4.filters.alpha.opacity=item4.filters.alpha.opacity-20

item5.style.pixelLeft=item5.style.pixelLeft-20

item5.filters.alpha.opacity=item5.filters.alpha.opacity-20

timelinestart=timelinestart-1

else

cleartimeout(tidtwo)

plane.style.display="none"

exit function

end if

tidtwo=settimeout("outit()",1)

end function

</script>

 

 

0 Comments

Tue

17

Mar

2009

119、图片对鼠标敏感

119、图片对鼠标敏感

脚本说明:

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

<script language="JavaScript1.2">

function expand() {

if (smallslot.width<=102) {

x=window.setTimeout('expand()', 10)

smallslot.width=smallslot.width + 5

smallslot.height=smallslot.height + 5}

else {

setTimeout('reduce()', 0)

}}

function reduce() {

if (smallslot.width>80) {

x=window.setTimeout('reduce()', 10)

smallslot.width=smallslot.width - 5

smallslot.height=smallslot.height - 5

}}</script>

<div id="slot1" onmouseover="expand()" style="HEIGHT: 102px; WIDTH: 80px">

<a href="http://www.7stk.com" target="_top">

<dd><img border="0" hspace="0" id="smallslot" src="1334.gif"

style="LEFT: 296px; POSITION: absolute; TOP: 104px; VISIBILITY: visible; z: 2" WIDTH="86"  HEIGHT="80"></a></dd>

</div>

 

0 Comments

Tue

17

Mar

2009

118、鼠标右键菜单特效

118、鼠标右键菜单特效

脚本说明:

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

<BODY oncontextmenu=window.event.returnValue=false bgcolor="#ffffff">

  <style type="text/css">

  <!--

  body           {font-size: 9pt;}

  table          {font-size: 9pt; cursor: default; margin: 0;}

  tr             {height: 20;}

  tr.over        {font-size: 9pt; color: #ffffff; background-color: #000080; cursor: default;}

  tr.out         {font-size: 9pt; color: #000000; background-color: #D4D0C8; cursor: default;}

  div.rm_div     {position: absolute; filter: Alpha(Opacity='95'); display: none; background-color: #D4D0C8; border: 2px outset #FFFFFF;width: 0; height: 0;padding:1}

  hr.sperator    {width:95%;border: 1px inset #FFFFFF;}

  -->

  </style>

  <script language="JScript">

  <!--

  function RightMenu()

  {

    this.AddExtendMenu=AddExtendMenu;

    this.AddItem=AddItem;

    this.GetMenu=GetMenu;

    this.HideAll=HideAll;

    this.I_OnMouseOver=I_OnMouseOver;

    this.I_OnMouseOut=I_OnMouseOut;

    this.I_OnMouseUp=I_OnMouseUp;

    this.P_OnMouseOver=P_OnMouseOver;

    this.P_OnMouseOut=P_OnMouseOut;

    A_rbpm = new Array();

    HTMLstr  = "";

    HTMLstr += "<!-- RightButton PopMenu -->\n";

    HTMLstr += "\n";

    HTMLstr += "<!-- PopMenu Starts -->\n";

    HTMLstr += "<div id='E_rbpm' class='rm_div'>\n";

                        // rbpm = right button pop menu

    HTMLstr += "<table width='100%' border='0' cellspacing='0'>\n";

    HTMLstr += "<!-- Insert A Extend Menu or Item On Here For E_rbpm -->\n";

    HTMLstr += "</table>\n";

    HTMLstr += "</div>\n";

    HTMLstr += "<!-- Insert A Extend_Menu Area on Here For E_rbpm -->";

    HTMLstr += "\n";

    HTMLstr += "<!-- PopMenu Ends -->\n";

  }

  function AddExtendMenu(id,name,parent)

  {

    var TempStr = "";

 

    eval("A_"+parent+".length++");

    eval("A_"+parent+"[A_"+parent+".length-1] = id");  // 将此项注册到父菜单项的ID数组中去

    TempStr += "<div id='E_"+id+"' class='rm_div'>\n";

    TempStr += "<table width='100%' border='0' cellspacing='0'>\n";

    TempStr += "<!-- Insert A Extend Menu or Item On Here For E_"+id+" -->";

    TempStr += "</table>\n";

    TempStr += "</div>\n";

    TempStr += "<!-- Insert A Extend_Menu Area on Here For E_"+id+" -->";

    TempStr += "<!-- Insert A Extend_Menu Area on Here For E_"+parent+" -->";

    HTMLstr = HTMLstr.replace("<!-- Insert A Extend_Menu Area on Here For E_"+parent+" -->",TempStr);

   

    eval("A_"+id+" = new Array()");

    TempStr  = "";

    TempStr += "<!-- Extend Item : P_"+id+" -->\n";

    TempStr += "<tr id='P_"+id+"' class='out'";

    TempStr += " onmouseover='P_OnMouseOver(\""+id+"\",\""+parent+"\")'";

    TempStr += " onmouseout='P_OnMouseOut(\""+id+"\",\""+parent+"\")'";

    TempStr += " onmouseup=window.event.cancelBubble=true;";

    TempStr += " onclick=window.event.cancelBubble=true;";

    TempStr += "><td nowrap>";

    TempStr += "  "+name+"   </td><td style='font-family: webdings; text-align: ;'>4";

    TempStr += "</td></tr>\n";

    TempStr += "<!-- Insert A Extend Menu or Item On Here For E_"+parent+" -->";

    HTMLstr = HTMLstr.replace("<!-- Insert A Extend Menu or Item On Here For E_"+parent+" -->",TempStr);

  }

  function AddItem(id,name,parent,location)

  {

    var TempStr = "";

    var ItemStr = "<!-- ITEM : I_"+id+" -->";

    if(id == "sperator")

    {

      TempStr += ItemStr+"\n";

      TempStr += "<tr class='out' onclick='window.event.cancelBubble=true;' onmouseup='window.event.cancelBubble=true;'><td colspan='2' height='1'><hr class='sperator'></td></tr>";

      TempStr += "<!-- Insert A Extend Menu or Item On Here For E_"+parent+" -->";

      HTMLstr = HTMLstr.replace("<!-- Insert A Extend Menu or Item On Here For E_"+parent+" -->",TempStr);

      return;

    }

    if(HTMLstr.indexOf(ItemStr) != -1)

    {

      alert("I_"+id+"already exist!");

      return;

    }

    TempStr += ItemStr+"\n";

    TempStr += "<tr id='I_"+id+"' class='out'";

    TempStr += " onmouseover='I_OnMouseOver(\""+id+"\",\""+parent+"\")'";

    TempStr += " onmouseout='I_OnMouseOut(\""+id+"\")'";

    TempStr += " onclick='window.event.cancelBubble=true;'";

    if(location == null)

      TempStr += " onmouseup='I_OnMouseUp(\""+id+"\",\""+parent+"\",null)'";

    else

      TempStr += " onmouseup='I_OnMouseUp(\""+id+"\",\""+parent+"\",\""+location+"\")'";

    TempStr += "><td nowrap>";

    TempStr += "  "+name+"  ";

    TempStr += "</td><td></td></tr>\n";

    TempStr += "<!-- Insert A Extend Menu or Item On Here For E_"+parent+" -->";

    HTMLstr = HTMLstr.replace("<!-- Insert A Extend Menu or Item On Here For E_"+parent+" -->",TempStr);

  }

  function GetMenu()

  {

    return HTMLstr;

  }

  function I_OnMouseOver(id,parent)

  {

    var Item;

    if(parent != "rbpm")

    {

      var ParentItem;

      ParentItem = eval("P_"+parent);

      ParentItem.className="over";

    }

    Item = eval("I_"+id);

    Item.className="over";

    HideAll(parent,1);

  }

  function I_OnMouseOut(id)

  {

    var Item;

    Item = eval("I_"+id);

    Item.className="out";

  }

  function I_OnMouseUp(id,parent,location)

  {

    var ParentMenu;

    window.event.cancelBubble=true;

    OnClick();

    ParentMenu = eval("E_"+parent);

    ParentMenu.display="none";

    if(location == null)

      eval("Do_"+id+"()");

    else

      window.open(location);

  }

  function P_OnMouseOver(id,parent)

  {

    var Item;

    var Extend;

    var Parent;

    if(parent != "rbpm")

    {

      var ParentItem;

      ParentItem = eval("P_"+parent);

      ParentItem.className="over";

    }

    HideAll(parent,1);

    Item = eval("P_"+id);

    Extend = eval("E_"+id);

    Parent = eval("E_"+parent);

    Item.className="over";

    Extend.style.display="block";

    Extend.style.posLeft=document.body.scrollLeft+Parent.offsetLeft+Parent.offsetWidth-4;

    if(Extend.style.posLeft+Extend.offsetWidth > document.body.scrollLeft+document.body.clientWidth)

        Extend.style.posLeft=Extend.style.posLeft-Parent.offsetWidth-Extend.offsetWidth+8;

    if(Extend.style.posLeft < 0) Extend.style.posLeft=document.body.scrollLeft+Parent.offsetLeft+Parent.offsetWidth;

    Extend.style.posTop=Parent.offsetTop+Item.offsetTop;

    if(Extend.style.posTop+Extend.offsetHeight > document.body.scrollTop+document.body.clientHeight)

      Extend.style.posTop=document.body.scrollTop+document.body.clientHeight-Extend.offsetHeight;

    if(Extend.style.posTop < 0) Extend.style.posTop=0;

  }

  function P_OnMouseOut(id,parent)

  {

  }

  function HideAll(id,flag)

  {

    var Area;

    var Temp;

    var i;

    if(!flag)

    {

      Temp = eval("E_"+id);

      Temp.style.display="none";

    }

    Area = eval("A_"+id);

    if(Area.length)

    {

      for(i=0; i < Area.length; i++)

      {

        HideAll(Area[i],0);

        Temp = eval("E_"+Area[i]);

        Temp.style.display="none";

        Temp = eval("P_"+Area[i]);

        Temp.className="out";

      }

    }

  }

 

  document.onmouseup=OnMouseUp;

  document.onclick=OnClick;

  function OnMouseUp()

  {

    if(window.event.button == 2)

    {

      var PopMenu;

      PopMenu = eval("E_rbpm");

      HideAll("rbpm",0);

      PopMenu.style.display="block";

      PopMenu.style.posLeft=document.body.scrollLeft+window.event.clientX;

      PopMenu.style.posTop=document.body.scrollTop+window.event.clientY;

      if(PopMenu.style.posLeft+PopMenu.offsetWidth > document.body.scrollLeft+document.body.clientWidth)

        PopMenu.style.posLeft=document.body.scrollLeft+document.body.clientWidth-PopMenu.offsetWidth;

      if(PopMenu.style.posLeft < 0) PopMenu.style.posLeft=0;

      if(PopMenu.style.posTop+PopMenu.offsetHeight > document.body.scrollTop+document.body.clientHeight)

        PopMenu.style.posTop=document.body.scrollTop+document.body.clientHeight-PopMenu.offsetHeight;

      if(PopMenu.style.posTop < 0) PopMenu.style.posTop=0;

    }

  }

  function OnClick()

  {

    HideAll("rbpm",0);

  }

  // Add Your Function on following

  function Do_viewcode(){window.location="view-source:"+window.location.href;}

  function Do_help(){window.showHelp(window.location);}

  function Do_exit() {window.close();}

  function Do_refresh() {window.location.reload();}

  function Do_back() {history.back();}

  function Do_forward() {history.forward();}

  function Do_author(){alert("姓名:杨俊\n网名:风舞影天(Snwcwt)\nE_mail:snwcwt.com@263.net\n个人主页:http://202.115.147.160/snwcwt(正在制作中)\n")}

  -->

  </script>

  <script language="JScript">

  <!--

  var menu = new RightMenu();

menu.AddExtendMenu("d_setting","&nbsp;活动桌面","rbpm");

menu.AddItem("ca_yesky1","自定义桌面","d_setting","http://www.cctv.com");

menu.AddItem("sperator","","C_program",null);

menu.AddItem("cp_51js","无忧脚本","C_program","http://www.cctv.com/");

menu.AddExtendMenu("range_icon","&nbsp;排列图标","rbpm");

menu.AddItem("setico","自动排列","range_icon",null);

menu.AddItem("exit","退出","leave",null);

menu.AddItem("folder_setting","&nbsp;自定义文件夹(<u>C</u>)...","rbpm",null);

menu.AddItem("refresh","&nbsp;刷新","rbpm",null);

menu.AddItem("sperator","","rbpm",null);

menu.AddItem("phase","&nbsp;<font disabled>粘贴</font>&nbsp;&nbsp;CTRL+Z","rbpm",null);

menu.AddExtendMenu("n_files","&nbsp;新建","rbpm");

menu.AddItem("f_folder","文件夹","n_files","http://www.cctv.com/");

menu.AddItem("shortcut","快捷方式","n_files","http://www.cctv.com/");

menu.AddItem("sperator","","n_files","");

menu.AddItem("f_txt","Microsoft Word 文档","n_files","http://www.cctv.com/");

menu.AddItem("f_htm","Microsoft Excel 工作表","n_files","http://www.cctv.com/");

menu.AddItem("sperator","","rbpm",null);

menu.AddItem("folder_pro","&nbsp;属性","rbpm",null);

document.writeln(menu.GetMenu());

  -->

</script>

 

0 Comments

Tue

17

Mar

2009

117、鼠标悬停颜色

117、鼠标悬停颜色

脚本说明:

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

<script language="javascript">

function flasher(){

 

var swap = new Array(3)

swap[0]="yellow"

swap[1]="red"

swap[2]="blue"

swap[3]="green"

swap[4]="skyblue"

swap[5]="salmon"

swap[6]="purple"

swap[7]="pink"

 

 

var i =Math.floor(Math.random() * 6) + 1

 

 

document.flash.button1.style.backgroundColor=swap[i]

document.flash.button1.style.color="yellow"

 

 

Stop=setTimeout("flasher()",50)

 

}

function stopFlash(){

clearTimeout(Stop)

}

 

</script>

<form name="flash">

<input type="button" name="button1" value="鼠标悬停颜色" onMouseOver="flasher()" onMouseOut="stopFlash()">

</form>

 

0 Comments

Tue

17

Mar

2009

116、录制鼠标的运动轨迹

116、录制鼠标的运动轨迹

脚本说明:

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

第一步<script language="JavaScript">

<!--

var mousex=new Array();

var mousey=new Array();

var i;

var j=0;

var k;

var recordcount=0;

var repeat;

var repeat2;

var repeat3;

var speed=50;

 

function startthis() {

recordcount=1;

i=0;

mousex=new Array();

mousey=new Array();

recordthis();

}

 

function recordthis() {

if (maxnum.value=='' || isNaN(maxnum.value) == true || maxnum.value<0) {

       if (recordcount==1) {

       mousex[i]=mousefollow.offsetLeft;

       mousey[i]=mousefollow.offsetTop;

       i++;

       k=i;

       textfield.value='无时间限制';

       }

}

else {

       if (recordcount==1) {

              if (i<maxnum.value) {

              mousex[i]=mousefollow.offsetLeft;

              mousey[i]=mousefollow.offsetTop;

              i++;

              k=i;

              textfield.value='剩余'+(maxnum.value-i)+'/50';

              }

              else {

              recordcount=0;

              textfield.value='时间到';}

              }

       }

repeat=setTimeout("recordthis()",20);

}

 

function stopthis() {

clearTimeout("repeat");

recordcount=0;

}

 

function playthis() {

clearTimeout("repeat");

clearTimeout("repeat3");

recordcount=0;

if (j<i-1) {

       arrow.style.pixelLeft=mousex[j];

       arrow.style.pixelTop=mousey[j];

       arrow.style.visibility='visible';

       j++;

       repeat2=setTimeout("playthis()",speed);

       }

else {clearTimeout("repeat2");

       arrow.style.visibility='hidden';

       j=0;

       }

}

 

function rewindthis() {

clearTimeout("repeat");

clearTimeout("repeat2");

recordcount=0;

if (k>0) {

       arrow.style.pixelLeft=mousex[k-1];

       arrow.style.pixelTop=mousey[k-1];

       arrow.style.visibility='visible';

       k--;

       repeat3=setTimeout("rewindthis()",speed);

       }

else {clearTimeout("repeat3");

       arrow.style.visibility='hidden';

       k=i;

       }

}

 

function follow() {

mousefollow.style.pixelLeft=document.body.scrollLeft+event.clientX;

mousefollow.style.pixelTop=document.body.scrollTop+event.clientY;

}

// -->

</script>

 

 

<div id="arrow" style="position:absolute; width:12px; height:21px; z-index:1;visibility:hidden"><img src="cursor.gif" ></div>

<div id="mousefollow" style="position:absolute; width:12px; height:21px; z-index:1;visibility:hidden">.</div>

<input type="text" name="maxnum" size="4" maxlength="4"><input type=button onclick=startthis() value=录制><input type=button onclick=stopthis() value=停止><input type=button onclick="speed=50;playthis()" value=播放><input type=button onclick="speed=2;playthis()" value=快放><input type=button onclick="speed=150;playthis()" value=慢放><input type=button onclick="speed=50;rewindthis()" value=倒放><input type="button" name="textfield" style="width:100px" value="无时间限制">

 

第二步:把<body>中的内容改为:

<BODY onmousemove=follow()>

 

0 Comments

Tue

17

Mar

2009

115、跟着鼠标移动的色彩

115、跟着鼠标移动的色彩

脚本说明:

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

<style type="text/css">

#home_tag {width: 200; height: 50; border-width: 1; border-color: black; border-style: solid; z-index: 10}

 

#home_label {width: 200; height: 50; position: absolute; top: 110; left: 200; z-index: 9}

 

#chiefs_tag {width: 200; height: 50; border-width: 1; border-color: black; border-style: solid; z-index: 12}

 

#chiefs_label {width: 200; height: 50; position: absolute; top: 110; left: 200; z-index: 11}

 

#members_tag {width: 200; height: 50; border-width: 1; border-color: black; border-style: solid; z-index: 14}

 

#members_label {width: 200; height: 50; position: absolute; top: 110; left: 300; z-index: 13}

 

#pictures_tag {width: 200; height: 50; border-width: 1; border-color: black; border-style: solid; z-index: 16}

 

#pictures_label {width: 200; height: 50; position: absolute; top: 110; left: 400; z-index: 15}

#links_tag {width: 200; height: 50; border-width: 1; border-color: black; border-style: solid; z-index: 18}

 

#links_label {width: 200; height: 50; position: absolute; top: 110; left: 500; z-index: 17}

</style>

<script language="JavaScript">

<!--

var where_to;

 

var the_timeout;

function moveIt()

       {

 

       if (background_tag.style.left<where_to)

 

              {

 

              background_tag.style.left=parseInt(background_tag.style.left) + 10;

 

              }

 

       if (background_tag.style.left>where_to)

 

              {

 

              background_tag.style.left=parseInt(background_tag.style.left) - 10;

 

              }

 

       the_timeout = setTimeout('moveIt()', 10);

 

       }

function getOverIt(the_tag)

       {

       clearTimeout(the_timeout);

 

       moveIt();

 

       where_to=the_tag.style.left;

 

       }

-->

</script>

<div id="background_tag" style="background: green; width: 200; height: 50; position: absolute; top: 110; left: 200; z-index: 8"></div>

<div id="home_tag" onMouseOver="getOverIt(home_tag);" style="position: absolute; top: 110; left: 200"></div>

<div id="chiefs_tag" onMouseOver="getOverIt(chiefs_tag);" style="position: absolute; top: 110; left: 200"></div>

<div id="members_tag" onMouseOver="getOverIt(members_tag);" style="position: absolute; top: 110; left: 300"></div>

<div id="pictures_tag" onMouseOver="getOverIt(pictures_tag);" style="position: absolute; top: 110; left: 400"></div>

<div id="links_tag" onMouseOver="getOverIt(links_tag);" style="position: absolute; top: 110; left: 500"></div>

 

0 Comments

Tue

17

Mar

2009

114、禁止鼠标右键代码?

114、禁止鼠标右键代码?

0 Comments

Tue

17

Mar

2009

113、疯狂的攻击鼠标代码?

113、疯狂的攻击鼠标代码?

 

 

0 Comments

Tue

17

Mar

2009

112、游荡的文字

112、游荡的文字

脚本说明:

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

<SCRIPT language=JavaScript>

<!--

 

//Stuff to change!------------------

msg="有问题请与我联系!";

mail="mailto:webmaster@javdfghfdhggfascript2000.com";

fnt='Verdana';

fsze='2';

speed=1;

//----------------------------------

 

Y=0,X=0,my=0,mx=0,angle=0,dy=0,dx=0,tmr=null;

ns=(document.layers)?1:0;

off=(document.layers)?'hide':'hidden';

on=(document.layers)?'show':'visible';

if (ns)

document.write('<layer name=n top=0 left=0><font face='+fnt+' size='+fsze+'><a href='+mail+'>'+msg+'</a></font></layer>');

else{

document.write('<div id="c" style="position:absolute"><div style="position:relative">');

document.write('<div id="i" style="position:absolute;width:200px;height:30px"><font face='+fnt+' size='+fsze+'><a href='+mail+'>'+msg+'</a></font></div>');

document.write('</div></div>');

}

if (ns){

window.captureEvents(Event.MOUSEMOVE);

function nMouse(evnt){                              

my=evnt.pageY+20;mx=evnt.pageX

}

}

else{

function iMouse(){

my=event.y+20;mx=event.x;

}

}

function stalk(){

if (ns) window.onMouseMove=nMouse;

else {document.onmousemove=iMouse;c.style.top=document.body.scrollTop}

var layer=(document.layers)?document.n:i.style;

Y=my-dy;X=mx-dx;

angle=Math.round(Math.atan2(Y,X)*180/Math.PI);

if (angle < 0) angle += 360;

y = Math.round(speed*Math.sin(angle*Math.PI/180));x = Math.round(speed*Math.cos(angle*Math.PI/180));

dy+=y;dx+=x;                                                                   

if ((dy > my-speed*2) && (dx > mx-speed*2) && (dy < my+speed*2) && (dx < mx+speed*2))

{clearTimeout(tmr);layer.visibility=off;}

else{layer.visibility=on;layer.top=dy;layer.left=dx}

tmr=setTimeout('stalk()',10);

}

stalk();

//-->

</SCRIPT>

 

 

0 Comments

Tue

17

Mar

2009

111、跟随鼠标的可酷文字

111、跟随鼠标的可酷文字

<html>

<script language="JavaScript">

<!-- Logo Orbit II kurt.grigg@virgin.net

 

yourLogo='欢迎来到7stk.com网页特效代码';

logoFont='Arial';

logoSize=9;

logoColor='red';

logoWidth=40;

logoHeight=40;

logoSpeed=0.03;

 

 

//Nothing needs altering below!

yourLogo=yourLogo.split('');

L=yourLogo.length;

Result="<font face="+logoFont+" style='font-size:"+logoSize+"pt' color="+logoColor+">";

TrigSplit=360/L;

br=(document.layers)?1:0;

if (br){

for (i=0; i < L; i++)

document.write('<layer name="ns'+i+'" top=0 left=0 width=14 height=14">'+Result+yourLogo[i]+'</font></layer>');

}

else{

document.write('<div id="outer" style="position:absolute;top:0px;left:0px"><div style="position:relative">');

for (i=0; i < L; i++)

document.write('<div id="ie" style="position:absolute;top:0px;left:0px;width:14px;height:14px">'+Result+yourLogo[i]+'</font></div>');

document.write('</div></div>');

}

ypos=0;

xpos=0;

step=logoSpeed;

currStep=0;

Y=new Array();

X=new Array();

Yn=new Array();

Xn=new Array();

for (i=0; i < L; i++)

 {

 Yn[i]=0;

 Xn[i]=0;

 }

(document.layers)?window.captureEvents(Event.MOUSEMOVE):0;

function Mouse(evnt){

 ypos = (document.layers)?evnt.pageY:event.y;

 xpos = (document.layers)?evnt.pageX:event.x;

}

(document.layers)?window.onMouseMove=Mouse:document.onmousemove=Mouse;

function animateLogo(){

if (!br)outer.style.pixelTop=document.body.scrollTop;

for (i=0; i < L; i++){

var layer=(document.layers)?document.layers['ns'+i]:ie[i].style;

layer.top =Y[i]+logoHeight*Math.sin(currStep+i*TrigSplit*Math.PI/180);

layer.left=X[i]+logoWidth*Math.cos(currStep+i*TrigSplit*Math.PI/180);

}

currStep-=step;

}

function Delay(){

for (i=L; i >= 0; i--)

{

Y[i]=Yn[i]+=(ypos-Yn[i])*(0.1+i/L);          

X[i]=Xn[i]+=(xpos-Xn[i])*(0.1+i/L);        

}

animateLogo();

setTimeout('Delay()',20);

}

window.onload=Delay;

// -->

</script>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<meta name="GENERATOR" content="Microsoft FrontPage 4.0">

<meta name="ProgId" content="FrontPage.Editor.Document">

<style>

<!--

body, td, div { font-family: Verdana; font-size: 9pt }

-->

</style>

<title>围绕鼠标转动的文字</title>

</head>

 

<body>

</body>

 

</html>

 

0 Comments

Tue

17

Mar

2009

110、能控制页面移动特效

110、能控制页面移动特效

<SCRIPT> 

var xx 

var v=1 

function ml() { 

clearTimeout(xx) 

window.moveBy(-v, 0); 

xx = setTimeout("ml()",140) 

} 

function mr() { 

clearTimeout(xx) 

window.moveBy(v, 0); 

xx = setTimeout("mr()",140) 

} 

function mu() { 

clearTimeout(xx) 

window.moveBy(0, -v); 

xx = setTimeout("mu()",140) 

} 

function md() { 

clearTimeout(xx) 

window.moveBy(0, v); 

xx = setTimeout("md()",140) 

} 

function ws(){ 

clearTimeout(xx) 

} 

function adj(i){ 

if (i==1){v+=1; if (v>5)v-=1} 

else {v-=1 

if (v==0)v=1} 

} 

</SCRIPT>

 

<DIV align=center>

<FORM><INPUT onclick=mu(v,0); type=button value=向上> <INPUT onclick=ml(v,0); type=button value=向左> <INPUT onclick=mr(0,v); type=button value=向右> <INPUT onclick=md(0,v); type=button value=向下> <INPUT onclick=ws(); type=button value=停止> <BR><BR><BR><INPUT onclick=adj(1); type=button value=加速> <INPUT onclick=adj(0); type=button value=减速> <BR></FORM></DIV>

 

0 Comments

Tue

17

Mar

2009

109、跟随鼠标的小图形

109、跟随鼠标的小图形

<STYLE type=TEXT/CSS>

.tm {

       FILTER: Alpha(Opacity=50)

}

</STYLE>

 <DIV id=Layer1  style="HEIGHT: 31px; LEFT: 409px; POSITION: absolute; TOP: 131px; WIDTH: 14px"><IMG  class=tm src="sto/girl01.gif"></DIV>

<SCRIPT>

function move_layer()

{

Layer1.style.left=event.clientX+document.body.scrollLeft+10;

Layer1.style.top=event.clientY+document.body.scrollTop+10;

top.status="鼠标X="+event.clientX + " sX=" + document.body.scrollLeft + " 鼠标Y=" + event.clientY+ "  sY=" + document.body.scrollTop;

}

document.onmousemove =move_layer;

</SCRIPT>

 

0 Comments

Tue

17

Mar

2009

108、鼠标右键新的效果

108、鼠标右键新的效果

脚本说明:

第一步:把如下代码加入<body>区域中

<style>#all .menu   { background-color: menu; cursor: hand; display: none; font-family: Arial;

               font-size: 9pt; color: 800000; left: 0px; overflow: hidden;

               position: absolute; top: 0px; border-left: 1px solid #efefef;

               border-right: 1px solid #505050; border-top: 1px solid #efefef;

               border-bottom: 1px solid #505050; margin: 0pt; padding: 3pt }

#all .menu span { cursor: default; width: 100%; padding-left: 10pt }

#all .menu span.selected { background-color: red; background-repeat: repeat; background-attachment:

               scroll; color: white; background-position: 0% }

body         { font-family: Verdana; color: #000080; font-size: 9pt }

</style>

<xml id=contextDef>

  <xmldata>

    <contextmenu id="demo">

<item id="open" value="打开(open)"/>

<item id="back" value="后退(back)"/>

<item id="saveas" value="保存(save)"/>

<item id="f5" value="刷新(refresh)"/>

<item id="exit" value="关闭(shut)"/>

<item id="print" value="打印(print)"/>

<item id="viewsource" value="查看源代码"/>

  </contextmenu>

  </xmldata>

</xml>

<SCRIPT>

// Define global script variables

var bContextKey=false;

 

// The fnDetermine function performs most of the work

 

function fnGetContextID(el) {

       while (el!=null) {

              if (el.contextmenu) return el.contextmenu

              el = el.parentElement

       }

       return ""

}

 

function fnDetermine(){

       oWorkItem=event.srcElement;

 

       // Proceed if the desired keyboard key is pressed.

       if(bContextKey==true){

              // If the menu STATUS is false, continue.

              if(oContextMenu.getAttribute("status")=="false"){

                     // Give the menu mouse capture so it can interact better with the page.

                     oContextMenu.setCapture();

 

                     // Relocate the menu to an offset from the mouse position.

                     oContextMenu.style.top=event.clientY + document.body.scrollTop + 1;

                     oContextMenu.style.left=event.clientX + document.body.scrollLeft +  1;

 

                     oContextMenu.innerHTML="";

                     // Set its STATUS to true.

                     var sContext = fnGetContextID(event.srcElement)

                     if (sContext!="") {

                            fnPopulate(sContext)

                            oContextMenu.setAttribute("status","true");

                            event.returnValue=false;

                     }

                     else

                            event.returnValue=true

              }

       }

       else{

              // If the keyboard key was not pressed and the menu status is true, continue.

              if(oContextMenu.getAttribute("status")=="true"){

                     // If the object that was clicked has the menu for a parent and it has a COMPONENT attribute equal to "menuitem", continue.

                     if((oWorkItem.parentElement.id=="oContextMenu")&&(oWorkItem.getAttribute("component")=="menuitem")){

                            fnFireContext(oWorkItem)

                     }

 

                     // Reset the context menu, release mouse capture, and hide it.    

                     oContextMenu.style.display="none";

                     oContextMenu.setAttribute("status","false");

                     oContextMenu.releaseCapture();

                     oContextMenu.innerHTML="";

                     event.returnValue=false;

              }

       }

}

             

 

function fnPopulate(sID) {

       var str=""

       var elMenuRoot = document.all.contextDef.XMLDocument.childNodes(0).selectSingleNode('contextmenu[@id="' + sID + '"]')

       if (elMenuRoot) {

              for(var i=0;i<elMenuRoot.childNodes.length;i++)

                     str+='<span component="menuitem" menuid="' + elMenuRoot.childNodes[i].getAttribute("id") + '" id=oMenuItem' + i + '>' + elMenuRoot.childNodes[i].getAttribute("value") + "</SPAN><BR>"

              oContextMenu.innerHTML=str;

              oContextMenu.style.display="block";

              oContextMenu.style.pixelHeight = oContextMenu.scrollHeight        

       }

}

 

function fnFireContext(oItem) {

       switch (oItem.menuid) {

              case "http1":

                     location.href = "http://www.51windows.com";

                     break;

                    case "viewsource":

                     location.href = "view-source:" + location.href

                     break;

              case "back":

                     history.back()

                     break;

                case "saveas":

               document.execCommand('SaveAs')

                     break;

                    case "open":

               document.execCommand('open')

                     break;

                    case "print":

               document.execCommand('print')

                     break;

                    case "exit":

location.href = "javascript:window.close()";

                     break;

                    case "f5":

location.href = "javascript:location.reload()";

                     break;

              default:

                     alert("You Selected:\nID: " + oItem.menuid + "\nText: " + oItem.innerText)

       }

}

 

/* The chirp functions provide visual appeal.  Notice that they are specific about only changing styles while the mouse is within the client window.  This is because setCapture allows the mouse to pick up coordinate values on the window (not the user's screen) and this can throw an error if you try to get a property from an object that isn't recognized. */

function fnChirpOn(){

       if((event.clientX>0)&&(event.clientY>0)&&(event.clientX<document.body.offsetWidth)&&(event.clientY<document.body.offsetHeight)){

              oWorkItem=event.srcElement;

              if(oWorkItem.getAttribute("component")=="menuitem"){

                     oWorkItem.className = "selected"

              }

       }

}

function fnChirpOff(){

       if((event.clientX>0)&&(event.clientY>0)&&(event.clientX<document.body.offsetWidth)&&(event.clientY<document.body.offsetHeight)){

              oWorkItem=event.srcElement;

              if(oWorkItem.getAttribute("component")=="menuitem"){

                     oWorkItem.className = ""

              }

       }

}

 

function fnInit(){

       if (oContextMenu) {

              oContextMenu.style.width=110;

              oContextMenu.style.height=document.body.offsetHeight/2;

              oContextMenu.style.zIndex=2;

              // Setup the basic styles of the context menu.

              document.oncontextmenu=fnSuppress;

       }

}

 

function fnInContext(el) {

       while (el!=null) {

              if (el.id=="oContextMenu") return true

              el = el.offsetParent

       }

       return false

}

 

function fnSuppress(){

       if (!(fnInContext(event.srcElement))) {

              oContextMenu.style.display="none";

              oContextMenu.setAttribute("status","false");

              oContextMenu.releaseCapture();

              bContextKey=true;

       }

 

       fnDetermine();

       bContextKey=false;

}

window.onload = fnInit;

document.onclick = fnDetermine;

</SCRIPT>

<div class="menu" id="oContextMenu" onmouseout="fnChirpOff()" onmouseover="fnChirpOn()" status="false" style="width: 147; height: 49">

</div>

 

 

 

第二步:把<body>中的内容改为:

<body id="all" text="#000000" contextmenu="demo">

 

0 Comments

Tue

17

Mar

2009

107、鼠标经过页面特殊变化

107、鼠标经过页面特殊变化

<SCRIPT language=JavaScript1.2>  

 

<!--  

 

function boom(n) {  

 

if (window.top.moveBy) {  

 

for (i = 14; i > 0; i--) {  

 

for (j = n; j > 0; j--) {  

 

window.top.moveBy(0,i);  

 

window.top.moveBy(i,0);  

 

window.top.moveBy(0,-i);  

 

window.top.moveBy(-i,0);  

 

} } }  

 

}  

 

function callJS(jsStr) {  

 

return eval(jsStr)}  

 

// End -->  

 

</SCRIPT>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<SCRIPT language=JavaScript1.2>  

 

<!--  

 

function boom(n) {  

 

if (window.top.moveBy) {  

 

for (i = 14; i > 0; i--) {  

 

for (j = n; j > 0; j--) {  

 

window.top.moveBy(0,i);  

 

window.top.moveBy(i,0);  

 

window.top.moveBy(0,-i);  

 

window.top.moveBy(-i,0);  

 

} } }  

 

}  

 

function callJS(jsStr) {  

 

return eval(jsStr)}  

 

// End -->  

 

</SCRIPT>

 

 

 

 

 

 

 

 

 

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

 

<A href="#"

 

onmouseover="callJS('boom(3)')"><br>

 

  鼠标经过整动</A><BR>

 

  <BR><BR>

 

  <A

 

href="#"

 

onmouseover=self.moveBy(5,10);>鼠标经过时移动</A><BR>

 

  <BR><BR><A

 

href="javascript:self.moveBy(15,20);">鼠标点击时移动</A>

 

</DIV>

 

</BODY></HTML>

 

 

0 Comments

Tue

17

Mar

2009

106、跟随鼠标的十字架

106、跟随鼠标的十字架

<html>

<head>

<title>鼠标十字线控制</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<style type="text/css">

<!--

#leftright{

position:absolute;

left:0;

top:0;

width:1px;

height:1px;

layer-background-color:black;

background-color:#CC9900;

z-index:100;

font-size:0px;

}

#topdown { position:absolute;

left:0;

top:0;

width:1px;

height:1px;

layer-background-color:black;

background-color:#CC9900;

z-index:100;

font-size:0px;

} a { color: #CC9900; text-decoration: none; cursor: default}

a:hover { color: #FF0000; text-decoration: none; cursor: default}

.article {

BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; FILTER: revealTrans(transition=23,duration=0.5) blendTrans(duration=0.5); POSITION: absolute; VISIBILITY: hidden

; padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; color: #CC9900}

-->

</style>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<script language=JavaScript1.2>

<!--

function high(which2){

theobject=which2

highlighting=setInterval("highlightit(theobject)",50)

}

function low(which2){

clearInterval(highlighting)

which2.filters.alpha.opacity=40

}

function highlightit(cur2){

if (cur2.filters.alpha.opacity<100)

cur2.filters.alpha.opacity+=10

else if (window.highlighting)

clearInterval(highlighting)

}

function navChange(formName, popupName, target) {

var popup = document[formName].elements[popupName];

if (popup.options[popup.selectedIndex].value != "") {

window.open(popup.options[popup.selectedIndex].value, target);

popup.selectedIndex=0;

}

}

function Show(divid) {

divid.filters.revealTrans.apply();

divid.style.visibility = "visible";

divid.filters.revealTrans.play();

}

function Hide(divid) {

divid.filters.revealTrans.apply();

divid.style.visibility = "hidden";

divid.filters.revealTrans.play();

}

function MM_openBrWindow(theURL,winName,features) { //v2.0

window.open(theURL,winName,features);

}

//-->

</script>

<script language="JavaScript">

<!--

function tmt_LayerSlider(targetNN, targetIE, x, y, step, delay) {

var changed = false;

if (document.layers) {

target = eval(targetNN);

if (eval(target.moving)) {

clearTimeout(target.tmtSlide);

}

if (target.left > x) {

target.left -= eval(step);

changed = true;

}

if (target.left < x) {

target.left += eval(step);

changed = true;

}

if (target.top > y) {

target.top -= eval(step);

changed = true;

}

if (target.top < y) {

target.top += eval(step);

changed = true;

}

if (changed) {

target.moving = true;

target.tmtSlide = setTimeout("tmt_LayerSlider(\"" + targetNN + "\",\"" + targetIE + "\",\"" + x + "\",\"" + y + "\",\"" + step + "\",\"" + delay + "\")", delay);

} else {

target.moving = false;

}

} else {

if (document.all) {

IEobjStr = targetIE.replace("['", ".");

target = eval(IEobjStr.replace("']", ""));

if (eval(target.moving)) {

clearTimeout(target.tmtSlide);

}

if (target.style.pixelLeft > x) {

target.style.pixelLeft -= eval(step);

changed = true;

}

if (target.style.pixelLeft < x) {

target.style.pixelLeft += eval(step);

changed = true;

}

if (target.style.pixelTop > y) {

target.style.pixelTop -= eval(step);

changed = true;

}

if (target.style.pixelTop < y) {

target.style.pixelTop += eval(step);

changed = true;

}

if (changed) {

target.moving = true;

target.tmtSlide = setTimeout("tmt_LayerSlider(\"" + targetNN + "\",\"" + targetIE + "\",\"" + x + "\",\"" + y + "\",\"" + step + "\",\"" + delay + "\")", delay);

} else {

target.moving = false;

}

}

}

}

//-->

</script>

</head>

 

<body bgcolor="#000000" text="#FFCC00">

<span></span>

<div id="leftright" style="width:expression(document.body.clientWidth-2)"></div>

<div id="topdown" style="height:expression(document.body.clientHeight-2)"></div>

<div id="Layer1" style="position:absolute; left:328px; top:216px; width:50px; height:20px; z-index:101; visibility: hidden" class="article">text2

</div>

<div id="Layer2" style="position:absolute; left:328px; top:116px; width:50px; height:20px; z-index:102" class="article">text1</div>

<p> </p>

<p> </p>

<p> </p>

<table width="300" border="0" cellspacing="0" cellpadding="0" height="128">

  <tr>

    <td height="50" align="right" class="my001"><a href="####" onMouseOut="tmt_LayerSlider('document.layers[\'leftright\']','document.all[\'leftright\']','0','0','22','50');tmt_LayerSlider('document.layers[\'topdown\']','document.all[\'topdown\']','0','0','32','50');Hide(Layer2)" onMouseOver="tmt_LayerSlider('document.layers[\'leftright\']','document.all[\'leftright\']','0','150','22','50');tmt_LayerSlider('document.layers[\'topdown\']','document.all[\'topdown\']','260','0','32','50');Show(Layer2)" class="my001" onFocus="if(this.blur)this.blur()">choose1

      </a></td>

  </tr>

  <tr>

    <td height="120" align="right"><a href="####" onMouseOut="tmt_LayerSlider('document.layers[\'leftright\']','document.all[\'leftright\']','0','0','22','50');tmt_LayerSlider('document.layers[\'topdown\']','document.all[\'topdown\']','0','0','32','50');Hide(Layer1)" onMouseOver="tmt_LayerSlider('document.layers[\'leftright\']','document.all[\'leftright\']','0','223','22','50');tmt_LayerSlider('document.layers[\'topdown\']','document.all[\'topdown\']','260','0','32','50');Show(Layer1)" onFocus="if(this.blur)this.blur()">choose2

      </a></td>

  </tr>

</table>

<span></span> <span></span>

<p> </p>

<center>

</center>

</body>

</html>

 

0 Comments

Tue

17

Mar

2009

105、鼠标使链接的文字变样

105、鼠标使链接的文字变样

以下代码加入<head>区域

以下代码加入<body>区域

<a href="home.html" style="color:navy"

onmouseover="this.style.fontWeight='bold';"

onmouseout="this.style.fontWeight='normal';">IE Users highlight

this and it will turn bold! </a>

 

0 Comments

Tue

17

Mar

2009

104、鼠标移动方向图形

104、鼠标移动方向图形

SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var x, y, xold, yold, xdiff, ydiff;

var dir = Array();

dir[0] = "n-resize";

dir[1]="ne-resize";

dir[2]="e-resize";

dir[3]="se-resize";

dir[4] = "s-resize";

dir[5]="sw-resize";

dir[6]="w-resize";

dir[7]="nw-resize";

document.onmousemove = FindXY;

function display(direction) {

document.body.style.cursor = dir[direction];

}

function FindXY(loc) {

x = (document.layers) ? loc.pageX : event.clientX;

y = (document.layers) ? loc.pageY : event.clientY;

xdiff = x - xold;

ydiff = y - yold

if ((xdiff <  2) && (ydiff < -2)) display(0);

if ((xdiff <  2) && (ydiff >  2)) display(4);

if ((xdiff >  2) && (ydiff <  2)) display(2);

if ((xdiff < -2) && (ydiff <  2)) display(6);

if ((xdiff >  2) && (ydiff >  2)) display(3);

if ((xdiff >  2) && (ydiff < -2)) display(1);

if ((xdiff < -2) && (ydiff >  2)) display(5);

if ((xdiff < -2) && (ydiff < -2)) display(7);

xold = x;

yold = y;

}

//  End -->

</script>

0 Comments

Tue

17

Mar

2009

103、飞舞的东西不是图片

103、飞舞的东西不是图片

<SCRIPT language=JavaScript1.2>

 

<!--

 

var intervals=2000

 

var sparksOn     = true;

 

var speed        = 40;

 

var power        = 3;

 

 

 

//Dont change these values-------

 

var documentWidth=documentHeight=randomx=randomy=leftcorner=topcorner=0

 

var ns=(document.layers);

 

var ie=(document.all);

 

var sparksAflyin = false;

 

var allDivs      = new Array(10);

 

var totalSparks  = 0;

 

//-------------------------------

 

 

 

function initAll(){

 

       if(!ns && !ie){

 

       sparksOn = false;

 

       return;

 

       }

 

setInterval("firework()",intervals)

 

 

 

if (ns)

 

       document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);

 

       for(dNum=0; dNum<7; ++dNum){

 

              if(ie)

 

                     allDivs[dNum]=eval('document.all.sDiv'+dNum+'.style');

 

              else

 

                     allDivs[dNum]=eval('document.layers["sDiv'+dNum+'"]');

 

       }

 

}

 

 

 

function firework(){

 

//below code detects the browser dimenions

 

if (ie){

 

documentWidth=document.body.clientWidth

 

documentHeight=document.body.clientHeight

 

leftcorner=document.body.scrollLeft

 

topcorner=document.body.scrollTop

 

}

 

else if (ns){

 

documentWidth=window.innerWidth

 

documentHeight=window.innerHeight

 

leftcorner=pageXOffset

 

topcorner=pageYOffset

 

 

 

}

 

//below code randomly generates a set of coordinates that fall within the dimension

 

randomx=leftcorner+Math.floor(Math.random()*documentWidth)

 

randomy=topcorner+Math.floor(Math.random()*documentHeight)

 

 

 

 

 

       if(sparksOn){

 

              if(!sparksAflyin){

 

                     sparksAflyin=true;

 

                     totalSparks=0;

 

                     for(var spark=0;spark<=6;spark++){

 

                            dx=Math.round(Math.random()*50);

 

                            dy=Math.round(Math.random()*50);

 

                            moveTo(spark,randomx,randomy,dx,dy);

 

                     }

 

              }

 

       }

 

}

 

 

 

function moveTo(i,tempx,tempy,dx,dy){

 

       if(ie){

 

              if(tempy+80>(document.body.offsetHeight+document.body.scrollTop))

 

                     tempy=document.body.offsetHeight+document.body.scrollTop-80;

 

              if(tempx+80>(document.body.offsetWidth+document.body.scrollLeft))

 

                     tempx=document.body.offsetWidth+document.body.scrollLeft-80;

 

       }

 

       if(tempx>-50&&tempy>-50){

 

              tempx+=dx;tempy+=dy;

 

              allDivs[i].left=tempx;

 

              allDivs[i].top=tempy;

 

              dx-=power;dy-=power;

 

              setTimeout("moveTo("+i+","+tempx+","+tempy+","+dx+","+dy+")",speed)

 

       }

 

       else

 

              ++totalSparks

 

       if(totalSparks==7){

 

              sparksAflyin=false;

 

              totalSparks=0;

 

       }

 

}

 

window.onload=initAll

 

//End-->

 

</SCRIPT>

 

 

 

<STYLE>#sDiv0 {

 

       COLOR: aqua; FONT-FAMILY: arial black; FONT-SIZE: 15px; HEIGHT: 1px; POSITION: absolute; WIDTH: 1px

 

}

 

#sDiv1 {

 

       COLOR: red; FONT-FAMILY: arial black; FONT-SIZE: 15px; HEIGHT: 1px; POSITION: absolute; WIDTH: 1px

 

}

 

#sDiv2 {

 

       COLOR: blue; FONT-FAMILY: arial black; FONT-SIZE: 15px; HEIGHT: 1px; POSITION: absolute; WIDTH: 1px

 

}

 

#sDiv3 {

 

       COLOR: orange; FONT-FAMILY: arial black; FONT-SIZE: 15px; HEIGHT: 1px; POSITION: absolute; WIDTH: 1px

 

}

 

#sDiv4 {

 

       COLOR: yellow; FONT-FAMILY: arial black; FONT-SIZE: 15px; HEIGHT: 1px; POSITION: absolute; WIDTH: 1px

 

}

 

#sDiv5 {

 

       COLOR: lightgreen; FONT-FAMILY: arial black; FONT-SIZE: 15px; HEIGHT: 1px; POSITION: absolute; WIDTH: 1px

 

}

 

#sDiv6 {

 

       COLOR: silver; FONT-FAMILY: arial black; FONT-SIZE: 15px; HEIGHT: 1px; POSITION: absolute; WIDTH: 1px

 

}

 

</STYLE>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

</script></CENTER>

 

<body bgcolor="#000000">

 

<DIV id=sDiv0>*</DIV>

 

<DIV id=sDiv1>*</DIV>

 

<DIV id=sDiv2>*</DIV>

 

<DIV id=sDiv3>*</DIV>

 

<DIV id=sDiv4>*</DIV>

 

<DIV id=sDiv5>*</DIV>

 

<DIV id=sDiv6>*</DIV>

 

<CENTER><font color=#ffffff>注意:飞舞的东西不是图片噢!</font></CENTER>

 

 

0 Comments

Tue

17

Mar

2009

102、鼠标双击判断

102、鼠标双击判断

脚本说明:

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

<input id=num value=1 size=4>

<input type=button value="是不是数字么?双击看结果" ondblclick=alert(!isNaN(num.value))>

 

 

0 Comments

Tue

17

Mar

2009

101、鼠标样式的变换

101、鼠标样式的变换

脚本说明:

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

<style type=text/css>

a:hover {

       cursor:url('sto/mouse.ani');

       color: #006600;

}

BODY {cursor:url('sto/mouse.ani')}

</style>

 

0 Comments

Tue

17

Mar

2009

100、鼠标上变化的文字

100、鼠标上变化的文字

脚本说明:

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

<SCRIPT language="JavaScript1.2">

<!--

 

var scroller_msg='7stk.com欢迎你的光临!'

 

var dismissafter=0

 

var initialvisible=0

if (document.all)

document.write('<marquee id="curscroll" style="position:absolute;width:150px;border:1px solid black;font-size:14px;background-color:white;visibility:hidden">'+scroller_msg+'</marquee>')

 

function followcursor(){

//move cursor function for IE

 

if (initialvisible==0){

curscroll.style.visibility="visible"

initialvisible=1

}

 

curscroll.style.left=document.body.scrollLeft+event.clientX+10

curscroll.style.top=document.body.scrollTop+event.clientY+10

}

 

function dismissmessage(){

curscroll.style.visibility="hidden"

}

 

 

if (document.all){

document.onmousemove=followcursor

document.ondblclick=dismissmessage

if (dismissafter!=0)

setTimeout("dismissmessage()",dismissafter*1000)

}

 

 

 

//-->

 </SCRIPT>

 

0 Comments

Tue

17

Mar

2009

99、鼠标接触链接窗口自打开

99、鼠标接触链接窗口自打开

以下代码加入<head>区域

<SCRIPT Language="JavaScript">function winopen () {msg=open("update.htm","NewWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=400,height=260");}</SCRIPT>

以下代码加入<body>区域

<a href="" onMouseOver="winopen(); return true;"><img src="file:///D%7C/My%20Documents/3838/2p.gif" border="0" width="63" height="56"></a>

 

0 Comments

Tue

17

Mar

2009

98、鼠标一离开,窗口就关闭

98、鼠标一离开,窗口就关闭

以下代码加入<head>区域

<SCRIPT Language="JavaScript">function winopen() {msg1=open("update.htm","Homepage","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=200,height=250");}</script>

 

以下代码加入<body>区域

<SCRIPT Language="JavaScript">function winopen1() {msg1=open("sh3.htm","Homepage","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=200,height=250");}</script>

<a href="" onMouseOver="winopen1(); return true;" onMouseOut="msg1.close();">update</a>

 

0 Comments

Tue

17

Mar

2009

97、随鼠标的旋转文字

97、随鼠标的旋转文字

脚本说明:

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

<script language="JavaScript">

<!--

yourLogo='http://www.7stk.com/';

logoFont='Arial';

logoSize=1; // 1-7 only! for larger font sizes alter logoWidth/Height accordingly!

logoColor='811188';

logoWidth=70;

logoHeight=70;

logoSpeed=0.03;

 

 

//Nothing needs altering below!

yourLogo=yourLogo.split('');

L=yourLogo.length;

Result="<font face="+logoFont+" size="+logoSize+" color="+logoColor+">";

TrigSplit=360/L;

br=(document.layers)?1:0;

if (br){

for (i=0; i < L; i++)

document.write('<layer name="ns'+i+'" top=0 left=0 width=14 height=14">'+Result+yourLogo[i]+'</font></layer>');

}

else{

document.write('<div id="outer" style="position:absolute;top:0px;left:0px"><div style="position:relative">');

for (i=0; i < L; i++)

document.write('<div id="ie" style="position:absolute;top:0px;left:0px;width:14px;height:14px">'+Result+yourLogo[i]+'</font></div>');

document.write('</div></div>');

}

ypos=0;

xpos=0;

step=logoSpeed;

currStep=0;

Y=new Array();

X=new Array();

Yn=new Array();

Xn=new Array();

for (i=0; i < L; i++)

 {

 Yn[i]=0;

 Xn[i]=0;

 }

(document.layers)?window.captureEvents(Event.MOUSEMOVE):0;

function Mouse(evnt){

 ypos = (document.layers)?evnt.pageY:event.y;

 xpos = (document.layers)?evnt.pageX:event.x;

}

(document.layers)?window.onMouseMove=Mouse:document.onmousemove=Mouse;

function animateLogo(){

if (!br)outer.style.pixelTop=document.body.scrollTop;

for (i=0; i < L; i++){

var layer=(document.layers)?document.layers['ns'+i]:ie[i].style;

layer.top =Y[i]+logoHeight*Math.sin(currStep+i*TrigSplit*Math.PI/180);

layer.left=X[i]+logoWidth*Math.cos(currStep+i*TrigSplit*Math.PI/180);

}

currStep-=step;

}

function Delay(){

for (i=L; i >= 0; i--)

{

Y[i]=Yn[i]+=(ypos-Yn[i])*(0.1+i/L);          

X[i]=Xn[i]+=(xpos-Xn[i])*(0.1+i/L);       

}

animateLogo();

setTimeout('Delay()',20);

}

window.onload=Delay;

// -->

</script>

0 Comments

Tue

17

Mar

2009

96、鼠标上方的晃动小球

96、鼠标上方的晃动小球

脚本说明:

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

<STYLE>

v\:* {

 BEHAVIOR: url(#default#VML)

}

</STYLE>

 <SCRIPT language="JavaScript1.2">

var stringcolor="black" //SPECIFY STRING COLOR

var ballsrc="superball.gif" //SPECIFY URL TO BALL IMAGE

 

///No editing required below this line//////////////////////////

 

if (document.all&&window.print){

document.write('<IMG id=Om style="LEFT: -10px; POSITION: absolute" src="'+ballsrc+'">')

ddx=0;ddy=0;PX=0;PY=0;xm=0;ym=0

OmW=Om.width/2;OmH=Om.height/2

}

 

function Ouille(){

 x=Math.round(PX+=(ddx+=((xm-PX-ddx)*3)/100))

 y=Math.round(PY+=(ddy+=((ym-PY-ddy)*3-300)/100))

 Om.style.left=x-OmW

 Om.style.top=y-OmH

 elastoc.to=x+","+y

 //elastoc.strokecolor="RGB("+x+","+(2*y)+",0)"

 elastoc.strokecolor=stringcolor

 setTimeout("Ouille()",1)  

}

function momouse(){

 xm=window.event.x+5

 ym=window.event.y+document.body.scrollTop+15

 elastoc.from=xm+","+ym

}

 

if(document.all&&window.print){

code="<v:line id=elastoc style='LEFT:0;POSITION:absolute;TOP:0' strokeweight='1.5pt'></v:line>"} else {

code="<v:group style='LEFT:-10;WIDTH:100pt;POSITION:absolute;TOP:0;HEIGHT:100pt' coordsize='21600,21600'><v:line id=elastoc style='LEFT:0;WIDTH:100pt;POSITION:absolute;TOP:0;HEIGHT:100pt' strokeweight='1.5pt'></v:line></v:group>"}

 

if(document.all&&window.print){

document.body.insertAdjacentHTML("afterBegin",code)

document.onmousemove=momouse

Ouille()

}

 

</SCRIPT>

 

0 Comments

Tue

17

Mar

2009

95、鼠标周围的文字宣传

95、鼠标周围的文字宣传

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript1.2">

<!--//

 

// your message here

var msg='welcome to 7stk.com';

 

var font='Verdana,Arial';

var size=7; // up to seven

var color='#ffcc33';

 

// This is not the rotation speed, its the reaction speed, keep low!

// Set this to 1 for just plain rotation w/out drag

var speed=.2;

 

// This is the rotation speed, set it negative if you want

// it to spin clockwise

var rotation=.2;

 

// Alter no variables past here!, unless you are good

//---------------------------------------------------

 

var ns=(document.layers);

var ie=(document.all);

var msg=msg.split('');

var n=msg.length;

var a=size*15;

var currStep=0;

var ymouse=0;

var xmouse=0;

var scrll=0;

var props="<font face="+font+" size="+size+" color="+color+">";

 

if (ie)

window.pageYOffset=0

 

// writes the message

       if (ns){

       for (i=0; i < n; i++)

              document.write('<layer name="nsmsg'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props+msg[i]+'</font></center></layer>');

       }

       if (ie){

              document.write('<div id="outer" style="position:absolute;top:0px;left:0px"><div style="position:relative">');

              for (i=0; i < n; i++)

                     document.write('<div id="iemsg" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center;font-weight:regular;cursor:default">'+props+msg[i]+'</font></div>');

                     document.write('</div></div>');

       }

       (ns)?window.captureEvents(Event.MOUSEMOVE):0;

 

function Mouse(evnt){

       ymouse = (ns)?evnt.pageY+20-(window.pageYOffset):event.y; // y-position

       xmouse = (ns)?evnt.pageX+20:event.x-20; // x-position

}

 

if (ns||ie)

(ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse;

y=new Array();

x=new Array();

Y=new Array();

X=new Array();

for (i=0; i < n; i++){

       y[i]=0;

       x[i]=0;

       Y[i]=0;

       X[i]=0;

}

 

function makecircle(){ // rotation properties

if (ie) outer.style.top=document.body.scrollTop;

currStep-=rotation;

       for (i=0; i < n; i++){ // makes the circle

              var d=(ns)?document.layers['nsmsg'+i]:iemsg[i].style;

              d.top=y[i]+a*Math.sin((currStep+i*1)/3.8)+window.pageYOffset-15;

              d.left=x[i]+a*Math.cos((currStep+i*1)/3.8)*2; // remove *2 for just a plain circle, not oval

       }

}

 

function drag(){ // makes the resistance

       scrll=(ns)?window.pageYOffset:0;

       y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);

       x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);

       for (var i=1; i < n; i++){

              y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed);

              x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed);

 

       }

       makecircle();

       // not rotation speed, leave at zero

       setTimeout('drag()',10);

}

if (ns||ie)window.onload=drag;

 

// -->

</SCRIPT>

 

0 Comments

Tue

17

Mar

2009

94、鼠标驱动状态栏显示信息

94、鼠标驱动状态栏显示信息

脚本说明:

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

<script>

var data="0123456789";

 

//set to 1 if not decrypting, set to 0 if decrypting

var done=1;

 

 

 

function statusIn(text){

       decrypt(text,2,1);

}

 

function statusOut(){

self.status='';

done=1;

}

 

//-------------------------\\

//decrypt(string, int, int)\\

//-------------------------\\

//

//text(string): the text to be decrypted on

//the status bar.

//

//max(int): the number of times a random string

//is displayed before the next character is

//'decrypted'.

//

//delay(int): the number of milliseconds between

//each display of a random string

//

//Example:

//decrypt('Enter my site.',10,10);

//

//text = 'Enter my site.' :: 'Enter my site.' is

//eventually decrypted

//

//max = 10 :: a different random string is dis-

//played 10 times before a new character is

//decrypted

 

function decrypt(text, max, delay){

       if (done){

              done = 0;

              decrypt_helper(text, max, delay,  0, max);

              }

      

}

 

function decrypt_helper(text, runs_left, delay, charvar, max){

       if (!done){

       runs_left = runs_left - 1;

       var status = text.substring(0,charvar);

       for(var current_char = charvar; current_char < text.length; current_char++){

              status += data.charAt(Math.round(Math.random()*data.length));

              }

       window.status = status;

       var rerun = "decrypt_helper('" + text + "'," + runs_left + "," + delay + "," + charvar + "," + max + ");"

       var new_char = charvar + 1;

       var next_char = "decrypt_helper('" + text + "'," + max + "," + delay + "," + new_char + "," + max + ");"

       if(runs_left > 0){

              setTimeout(rerun, delay);

              }

       else{

              if (charvar < text.length){

                     setTimeout(next_char, Math.round(delay*(charvar+3)/(charvar+1)));

                     }

              else

                     {

                     done = 1;

                     }

              }

       }

}

 

</script>在姿态栏上显示信息<a href="#" onmouseover="decrypt('这是慢慢显示出来的信息',2,1);return true" onmouseout="done=1;status=''">演示</a>

 

0 Comments

Tue

17

Mar

2009

93、鼠标操作页面滚动

93、鼠标操作页面滚动

脚本说明:

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

<script language="JavaScript">

var currentpos,timer;

function initialize()

{

timer=setInterval("scrollwindow()",100);

}

function sc(){

clearInterval(timer);     

}

function scrollwindow()

{

currentpos=document.body.scrollTop;

window.scroll(0,++currentpos);

if (currentpos != document.body.scrollTop)

sc();

}

document.onmousedown=sc

document.ondblclick=initialize

</script>

 

0 Comments

Tue

17

Mar

2009

92、显示鼠标运动的轨迹

92、显示鼠标运动的轨迹

脚本说明:

<script>

var x=1;

var y=1;

var linestr="";

var intCharTotal=0;

function drawdot(){

var str="";

x=event.x;

y=event.y;

linestr+="<div style=\"position:absolute;left:"+x+"px;top:"+y+"px;width:1;height:1;background:red;font-size:0\"></div>";

intCharTotal+=1;

}

function drawall(){

document.write (linestr);

document.close();

window.status=intCharTotal;

}

document.onclick=drawall;

document.onmousemove=drawdot;

</script>

 

0 Comments

Tue

17

Mar

2009

91、鼠标周围的宣传文字

91、鼠标周围的宣传文字

脚本说明:

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

<script language="JavaScript">

<!--

var mouse=new Object()

mouse.msg="7stk.com欢迎你的光临"

mouse.x=0

mouse.y=0

mouse.speed=Math.PI/180  // 1 degree

mouse.radius=50

mouse.ms=new Array()

if(document.layers){

 document.captureEvents(Event.MOUSEMOVE)

 for(i=0;i<=mouse.msg.length;i++)document.write("<layer name='mousetext"+i+"'>"+mouse.msg.charAt(i)+"</layer>")

}else

 for(i=0;i<=mouse.msg.length;i++)document.write("<span id='mousetext"+i+"' class='tacoscript'>"+mouse.msg.charAt(i)+"</span>")

for(i=0;i<=mouse.msg.length;i++){

 mouse.ms[i]=document.getElementById?document.getElementById("mousetext"+i).style:document.all?document.all["mousetext"+i].style:document.layers["mousetext"+i]

 mouse.ms[i].deg=Math.PI*2/mouse.msg.length*i}

document.onmousemove=function m(e){

 if(!e)e=event

 mouse.x=document.all?document.body.scrollLeft+e.clientX:e.pageX

 mouse.y=document.all?document.body.scrollTop+e.clientY:e.pageY

 run()}

function run(){

 for(i=mouse.ms.length-1;i>=0;i--){

  mouse.ms[i].deg+=mouse.speed

  mouse.ms[i].left=mouse.x-Math.sin(mouse.ms[i].deg)*mouse.radius

  mouse.ms[i].top=mouse.y+Math.cos(mouse.ms[i].deg)*mouse.radius}}

setInterval(run,100)

//-->

</script>

<style type="text/css">

<!--

.tacoscript {font-size:10pt;POSITION: absolute;VISIBILITY: visible}

-->

</style>

 

0 Comments