问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

求dreamweaver 8中鼠标指针滑动出现花瓣类似的图案的方法,详细点!

发布网友 发布时间:2022-05-29 07:15

我来回答

3个回答

热心网友 时间:2023-10-10 18:03

随着鼠标滑动,可以出现文字爆米花的效果,文字你可以自己设置。脚本说明:

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

<SCRIPT LANGUAGE="JavaScript1.2">

var ver = navigator.appVersion;

var dom = document.getElementById ? 1 : 0;

var ie5 = (ver.indexOf("MSIE 5") > -1 && dom) ? 1 : 0;

var n = (document.layers);

var ie = (document.all);

var sparksAflyin = 0;

var totalSparks = 0;

var sparksOn = 1;

function initMouseEvents() {

document.onmousedown = mouseDown;

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

}

function mouseDown(e) {

if (sparksOn) {

var mousex = (n) ? e.pageX : event.x+document.body.scrollLeft;

var mousey = (n) ? e.pageY : event.y+document.body.scrollTop;

if (!sparksAflyin) {

for (var k = 0; k <= 9; k++)

eval('SHOW("sDiv'+k+'")');

sparksAflyin = 1;

totalSparks = 0;

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

eval('moveTo('+i+',0,'+mousex+','+mousey+')');

}

}

}

function moveTo(i,j, mousex, mousey){

if (j < eval('anim_'+i+'_x.length') ){

var tempx = eval('anim_'+i+'_x[j]+mousex');

var tempy = eval('anim_'+i+'_y[j]+mousey');

if (ie) {

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

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

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

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

eval('document.all.sDiv'+i+'.style.left = tempx;');

eval('document.all.sDiv'+i+'.style.top = tempy;');

}

if (n) {

eval('document.layers.sDiv'+i+'.left = tempx;');

eval('document.layers.sDiv'+i+'.top = tempy;');

}

j++;

// timeout: 50 = fireworks speed, larger number = slower speed

setTimeout("moveTo("+i+","+j+","+mousex+","+mousey+")",50)

}

else {

eval('HIDE("sDiv'+i+'")');

totalSparks++;

}

if (totalSparks == 10) {

sparksAflyin = 0;

totalSparks = 0;

}

}

function SHOW(divName){

if (document.all)

eval('document.all.'+divName+'.style.visibility = "visible";');

else if (document.layers)

eval('document.layers["'+divName+'"].visibility = "visible";');

}

function HIDE(divName){

if (document.all)

eval('document.all.'+divName+'.style.visibility = "hidden";');

else if (document.layers)

eval('document.layers["'+divName+'"].visibility = "hide";');

}

anim_0_x=new Array(20,20,10,0,0,0,0,0,0,0,0,0);

anim_0_y=new Array(-20,-40,-60,-80,-60,-40,-20,0,20,40,60,80);

anim_1_x=new Array(20,20,17,36,60,78,90,92,93,98,108,120,133,152,181);

anim_1_y=new Array(-20,-20,-33,-38,-38,-27,-2,25,51,84,113,141,162,212,253);

anim_2_x=new Array(20,20,2,3,4,5,6,7,8,9,10,12,13,15,18);

anim_2_y=new Array(-20,-20,-33,-38,-38,-27,-2,25,51,84,113,141,162,212,253);

anim_3_x=new Array(-20,-20,-2,-1,7,10,18,35,60,102,94,94,93,97,108,111,117,127);

anim_3_y=new Array(-20,-25,-64,-89,-104,-150,-173,-197,-213,-199,-151,-101,-66,-17,27,87,140,189);

anim_4_x=new Array(-20,-20,-10,-39,-30,-69,-64,-138,-154,-200,-181,-209,-191,-207,-203,-213,-202,-221,-211);

anim_4_y=new Array(-20,-20,-28,-51,-79,-100,-135,-154,-193,-183,-149,-134,-89,-60,8,51,107,157,201);

anim_5_x=new Array(-20,-29,-51,-72,-105,-133,-164,-189,-209,-229,-247,-270,-279,-282,-283,-283,-285,-286,-288);

anim_5_y=new Array(-20,-55,-86,-116,-154,-183,-205,-217,-217,-198,-169,-120,-44,-8,40,87,144,190,248);

anim_6_x=new Array(-20,-20,-7,14,44,79,143,186,217,226,234,244,250,259,265,274);

anim_6_y=new Array(-20,-21,-72,-113,-139,-166,-188,-181,-126,-68,-3,54,134,187,215,257);

anim_7_x=new Array(20,20,-3,-9,-13,-27,-33,-44,-54,-66,-77,-95,-107,-136,-150,-160,-164,-168,-171,-172,-172,-176,-175);

anim_7_y=new Array(-20,-26,-43,-63,-89,-116,-145,-169,-201,-222,-240,-253,-254,-245,-220,-195,-160,-124,-81,-53,-26,19,68);

anim_8_x=new Array(-20,20,-35,39,0,45,-1,24,-15,14,-20,35,-18,38,-11,16,49,64,81,93,100,103,109);

anim_8_y=new Array(-20,-20,-32,-42,-62,-76,-89,-107,-132,-147,-173,-180,-192,-209,-236,-193,-119,-73,-24,51,95,130,188);

anim_9_x=new Array(-20,-51,-89,-110,-165,-191,-228,-240,-259,-271,-277,-281,-287);

anim_9_y=new Array(-20,-20,-35,-37,-34,-16,10,47,105,150,189,227,273);

// End -->

</script>

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

<div id="sparks">

<div id="sDiv0" style="position:absolute; visibility: hidden;"><font face="arial black"

color="red">欢</font></div>

<div id="sDiv1" style="position:absolute; visibility: hidden;"><font face="arial black"

color="yellow">迎</font></div>

<div id="sDiv2" style="position:absolute; visibility: hidden;"><font face="arial black"

color="blue">光</font></div>

<div id="sDiv3" style="position:absolute; visibility: hidden;"><font face="arial black"

color="red">临</font></div>

<div id="sDiv4" style="position:absolute; visibility: hidden;"><font face="arial black"

color="orange">开</font></div>

<div id="sDiv5" style="position:absolute; visibility: hidden;"><font face="arial black"

color="white">心</font></div>

<div id="sDiv6" style="position:absolute; visibility: hidden;"><font face="arial black"

color="green">快</font></div>

<div id="sDiv7" style="position:absolute; visibility: hidden;"><font face="arial black"

color="skyblue">乐</font></div>

<div id="sDiv8" style="position:absolute; visibility: hidden;"><font face="arial black"

color="yellow">哦</font></div>

<div id="sDiv9" style="position:absolute; visibility: hidden;"><font face="arial black"

color="white">!</font></div>

</div>

第三步:把“OnLoad="initMouseEvents()"”加在<body>标记里
例如:<body OnLoad="initMouseEvents()">追问完全没反应!

热心网友 时间:2023-10-10 18:03

  脚本说明:

  把如下代码加入<body>区域中
  <script language="JavaScript">
  var color = "green";//Change this color to whatever you want
  var noscroll = false;//Set this to true if your page can wholly display on screen
  var delay = 30;//Refresh time
  var dotn = 6;//Number of flashing dots (15 or more may delay your system)

  //YOU DON'T HAVE TO EDIT BELOW THIS LINE

  var ms = navigator.appVersion.indexOf("MSIE");
  var ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4);
  var userAgent=navigator.appName+" "+navigator.appVersion;
  var agentInfo=userAgent.substring(0, 12);
  var ns4 = (agentInfo>="Netscape 4.0");

  if (ie4||ns4)
  {
  var currStep = 0;
  var step = 0.2;
  var x = 50;
  var y = 50;
  var w = 200;
  var h = 200;
  var j = 0;
  var mdown = false;
  var tempx;
  var tempy;
  var G = 0;
  var ColorStep = 5;

  //Internet Explorer 4 Settings

  if (ie4)
  {
  for (j=0;j<dotn;j++)
  {
  document.write("<div id=\"a\" style=\"position: absolute; width: 0px; height: 0px; background-color: " + color + "; border: solid 2px " + color + "\"><\/div>");
  }

  function MouseMove()
  {
  x = window.event.x;
  y = window.event.y;
  }
  document.onmousemove = MouseMove;

  function MouseDown()
  {
  mdown=true;
  }
  document.onmousedown = MouseDown;
  function MouseUp()
  {
  mdown=false;
  }
  document.onmouseup= MouseUp;
  }

  //End of Internet Explorer 4 Settings

  //Netscape 4 Settings

  if(ns4)
  {
  window.captureEvents(Event.MOUSEMOVE);
  for (j=0;j<dotn;j++)
  {
  document.write("<layer LEFT=\"10\" TOP=\"10\" VISIBILITY=\"SHOW\" BGCOLOR=\"" + color + "\" CLIP=\"0,0,3,3\"><\/layer>");
  }

  function MoveHandler(evnt)
  {
  x = evnt.pageX ;
  y = evnt.pageY ;
  }
  window.onMouseMove = MoveHandler;
  }

  //End of Netscape 4 Settings

  //Animation function begins here

  function FlashDots()
  {
  if (ie4)
  {
  w = document.body.clientWidth/4;
  h = document.body.clientHeight/4;
  }
  else if (ns4)
  {
  w = window.innerWidth/4;
  h = window.innerHeight/4;
  }
  if (mdown)
  {
  w=w/2;
  h=h/2;
  }

  for (j=0;j<dotn;j++)
  {
  if (ie4)
  {
  tempy = y+Math.cos((20*Math.sin(currStep/(20+j)))+j*70)* h *(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep+j*25)/10);
  if ((tempy > document.body.clientHeight-10) && (noscroll == true))
  {
  a[j].style.posTop = -50;
  }
  else
  {
  a[j].style.posTop = tempy;
  }
  tempx = x+Math.sin((20*Math.sin(currStep/20))+j*70)* w *(Math.sin(10+currStep/(10+j))+0.2)*Math.cos((currStep+j*25)/10);
  if (tempx > document.body.clientWidth-10)
  {
  a[j].style.posLeft = -50;
  }
  else
  {
  a[j].style.posLeft = tempx;
  }
  a[j].style.borderColor = "RGB(255," + G + ",0)";
  }
  else if (ns4)
  {
  document.layers[j].top = y+Math.cos((20*Math.sin(currStep/(20+j)))+j*70)* h *(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10);
  document.layers[j].left =x+Math.sin((20*Math.sin(currStep/20))+j*70)* w *(Math.sin(10+currStep/(10+j))+0.2)*Math.cos((currStep + j*25)/10);
  document.layers[j].bgcolor = "RGB(255," + G + ",0)";
  }
  }
  G += ColorStep;
  if ((G >= 255) || (G <= 0))
  {
  ColorStep *= -1;
  }
  currStep+=step;
  if (currStep>1000){currStep=0;}
  setTimeout("FlashDots()", delay);
  }

  //End of animation function

  FlashDots();
  }
  </script>

  如果不行,我还有别的样子的。

热心网友 时间:2023-10-10 18:04

这个很简单,dw里有鼠标经过动画。如果会js的话完全可以自己写代码追问可以发一下步骤吗?就是不懂怎么写啊!详细点得步骤!

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
说课包括哪些方面 说课内容包括()。 如何在手机百度上删除对话记录? 结核病是什么样的疾病? 曹丕17岁得了肺痨,明知自己命不长久,还要强争王位,是不是很自私呢?_百... 古代小说常出现的病名 急求一篇"生活小窍门"(500字)的作文 至今最有什么小妙招 健康的戒烟方法 笔记本电池锁死是什么原因引起的? 如何使用Anim8or软件建模? EDANim8是什么牌子的监护仪 澳门人可凭澳门身份证上高铁吗 搭高铁去澳门过关,是到哪个高铁站 首信易支付有名吗? 珠海北高铁站能去澳门吗? 去澳门有火车吗? 清远去澳门可以搭高铁吗 没有身份证可能用澳门通行证坐高铁吗? 在虎门坐高铁 去到 哪里 是可以去 澳门 的? 我在信阳想去澳门坐高铁怎么坐? 从广州去澳门是开车好还是做高铁好? 港澳通行证可以坐高铁吗? 听说利亚德有生产氮化镓这种材料,是真的吗? 宝马z4敞蓬跑车和奥迪TT Roadster 2.0 TFSI 的价格和性能对比 宝马z4敞蓬跑车价格谁知道 ISO28000认证证书的有效期限是多长?如何查询供应链管理体系认证的资质? BMW z4 敞蓬多钱! 谁看过长江ba号,周星驰的儿子叫什么?”拜托各位了 3Q 谁看过长江ba号,周星驰的儿子叫什么?” 我的平板电脑卡屏了,关不了机,一直亮屏那怎么办 国家的崛起的战斗机、轰炸机、战舰及核潜艇发射导弹修改方法 三星平板卡屏怎么办 华岩的熊嘎婆主题公园 魔幻水立方在哪 公司给本人配一台笔记本,我想创建两个用户,上班一个,自己娱乐一个 在线客服系统代码是什 芝麻信用分下降会怎么样 雪囍保鲜柜怎么调夏天的温度? 现代领动叫什么 京东入驻考试多少分及格 怎么获取京东积分 雀巢小佳膳和小百肽的区别,小百肽和小佳膳的区别 为什么抖音上有的可以上门有的不能上门服务 抖音上九块九的学而思网校加微信上课是真的吗? 想问问大家,小百肽和纽荃星哪个更适合给1岁以下的宝宝增重? 抖音里知行哥上课靠谱吗 雀巢小百肽好吗 蔼儿舒和小百肽有什么区别吗? 雀巢小百肽