怎样做出随鼠标光标移动而文字摆动的网页?(另需留言薄示例)

trybird 2000-04-11 03:30:00
加精
让鼠标光标移动而自定义的字符串(也有的是图象,比如一朵花)随之摆动的网页
好象是用JavaScript写就的,哪能位朋友,谁有现成可用的例程能提供出来。
先多谢了!
另需最简明的ASP留言薄示例(代码最小,存取到.txt文件也就行了)。
...全文
572 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
new_hong 2000-08-29
  • 打赏
  • 举报
回复
<script language="JavaScript1.2" fptype="dynamicanimation" src="animate.js">
</script>
</head>

<body onload="dynAnimation()" bgcolor="#000000">

<script language="JavaScript1.2" fptype="dynamicanimation" src="animate.js">
</script>
<P style="position: relative! important; visibility: hidden"
dynamicanimation="fpAnimdropWordFP1" id="fpAnimdropWordFP1" language="Javascript1.2">  </P>
<DIV id=Layer20
style="HEIGHT: 30px; LEFT: 592px; POSITION: absolute; TOP: 469px; VISIBILITY: hidden; WIDTH: 101px; Z-INDEX: 25"><IMG
border=0 height=26 src="Count.gif" width=96 NOSAVE></DIV>
<DIV id=trailSprite1
style="HEIGHT: 36px; LEFT: 600px; POSITION: absolute; TOP: 5px; VISIBILITY: hidden; WIDTH: 36px; Z-INDEX: 109">
<DD><IMG height=36 name=trailSprite1img
src="../images/trailgif1.gif" width=36> </DD></DIV>
<DIV id=trailSprite2
style="HEIGHT: 36px; LEFT: 600px; POSITION: absolute; TOP: 5px; VISIBILITY: hidden; WIDTH: 36px; Z-INDEX: 107">
<DD><IMG height=36 name=trailSprite2img src="../images/trailgif4.gif"
width=36> </DD></DIV>
<DIV id=trailSprite3
style="HEIGHT: 36px; LEFT: 600px; POSITION: absolute; TOP: 5px; VISIBILITY: hidden; WIDTH: 36px; Z-INDEX: 106">
<DD><IMG height=36 name=trailSprite3img src="../images/trailgif5.gif"
width=36> </DD></DIV>
<DIV id=trailSprite4
style="HEIGHT: 36px; LEFT: 600px; POSITION: absolute; TOP: 5px; VISIBILITY: hidden; WIDTH: 36px; Z-INDEX: 105">
<DD><IMG height=36 name=trailSprite4img src="../images/trailgif3.gif"
width=36> </DD></DIV>
<DIV id=trailSprite5
style="HEIGHT: 36px; LEFT: 600px; POSITION: absolute; TOP: 5px; VISIBILITY: hidden; WIDTH: 36px; Z-INDEX: 104">
<DD><IMG height=36 name=trailSprite5img src="../images/trailgif2.gif"
width=36> </DD></DIV>
<DIV id=Layer5
style="HEIGHT: 38px; LEFT: 510px; POSITION: absolute; TOP: 440px; VISIBILITY: hidden; WIDTH: 32px; Z-INDEX: 17"><EMBED src=chanmian.mid autostart="true" loop="true" width="128" height="128">
</DIV><!--多彩鼠标开始-->
<SCRIPT>
var isNS = (navigator.appName == "Netscape");
layerRef = (isNS) ? "document" : "document.all";
styleRef = (isNS) ? "" : ".style";

var queue = new Array();

var NUM_OF_TRAIL_PARTS = 5

for (x=1; x < 6; x++) { ///////////////Image Preload
eval("trailSpriteFrame" + x + " = new Image(36,36);");
eval("trailSpriteFrame" + x + ".src = 'trailgif" + x + ".gif';");
}

////////////////////////////////////////////////The trail Object

function trailSpriteObj(anID) {
this.trailSpriteID = "trailSprite" + anID; //as before
this.imgRef = "trailSprite" + anID + "img"; //reference to the sprites image name
this.currentFrame = 1; //the varible for looking after the frame
this.animateTrailSprite = animateTrailSprite; //declare the objects method cycle
}

function animateTrailSprite() {
if (this.currentFrame <6 ) { //if there are animation frames left, the change sprites the current frame
if (isNS) { //Detect the browser and perform coresponding image switch
eval("document." + this.trailSpriteID +".document['"+ this.imgRef + "'].src = trailSpriteFrame" + this.currentFrame + ".src");
} else {
eval("document['" + this.imgRef + "'].src = trailSpriteFrame" + this.currentFrame + ".src");
}
this.currentFrame ++; //and increase the objects current frame
} else { //the current frame has reached its limit so hide the sprite
eval(layerRef + '.' + this.trailSpriteID + styleRef + '.visibility = "hidden"');
}
}

/////////////////////////////////////////////////////////////////

function processAnim() {
for(x=0; x < NUM_OF_TRAIL_PARTS; x++)
queue[x].animateTrailSprite();
}

function processMouse(e) {
currentObj = shuffleQueue();
if (isNS) {
eval("document." + currentObj + ".left = e.pageX - 10 ;");
eval("document." + currentObj + ".top = e.pageY + 10;");
} else {
eval("document.all." + currentObj + ".style.pixelLeft = event.clientX + document.body.scrollLeft - 10 ;");
eval("document.all." + currentObj + ".style.pixelTop = event.clientY + document.body.scrollTop + 10;");
}
}

function shuffleQueue() {
lastItemPos = queue.length - 1;
lastItem = queue[lastItemPos];
for (i = lastItemPos; i>0; i--)
queue[i] = queue[i-1];
queue[0] = lastItem;

queue[0].currentFrame = 1; //reset the objects frame number & make the sprite visible again
eval(layerRef + '.' + queue[0].trailSpriteID + styleRef + '.visibility = "visible"');

return queue[0].trailSpriteID;
}

function init() {

for(x=0; x<NUM_OF_TRAIL_PARTS; x++) //fill array with trail objects
queue[x] = new trailSpriteObj(x+1) ;

if (isNS) { document.captureEvents(Event.MOUSEMOVE); }
document.onmousemove = processMouse;

setInterval("processAnim();",60);
}

window.onload = init;
</SCRIPT>
<!--结束-->
dengdun 2000-04-11
  • 打赏
  • 举报
回复
给你介绍个站点,上面有很多很不错的javascript小程序及asp远嘛。
http://java2000.126.com/
trybird 2000-04-11
  • 打赏
  • 举报
回复
指针移动到哪,字串就跟到哪的。

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧