myway 发表于 2007-4-27 12:03:29

***按钮特效***打雷喽 下雨收衣服呀~~~~~

把下列代码加到网页的<body></body>标签之间 从google下载我的照片管理软件
要完成此效果需要两个步骤

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

<style>
.mainbody {
    position: absolute;
    top:100px;
    left:260px;
    width:300px;
    font-family:arial;
    font-size:12pt;
    color:ffffff;
}
.soundpic {
    position: absolute;
    top:-400px;
    left:-400px;
}

a {
    color:ff0000;
    text-decoration:underline overline;
}
</style>


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

<script>
<!-- beginning of javascript -
var x,y,i
var shakestrength=30
var i=shakestrength
var vorzeichen=1

function showsoundpic() {
    if (document.all) {
      document.all.soundgif1.style.postop=y-100
      document.all.soundgif1.style.posleft=x
      shakesound()
   }

       if (document.layers) {
      document.soundgif1.top=y-100
      document.soundgif1.left=x
      shakesound()
   }
}

function shakesound() {
    if (document.all) {
      if (i > 0) {
            document.all.soundgif1.style.postop+=i*vorzeichen
            document.all.soundgif1.style.posleft+=i*vorzeichen
            vorzeichen=vorzeichen*(-1)
            i--
            var timer=settimeout("shakesound()",50)
      }
      else {
            document.all.soundgif1.style.postop=-400
            document.all.soundgif1.style.posleft=-400
            i=shakestrength
            cleartimeout(timer)
      }
   }

       if (document.layers) {
      if (i > 0) {
            document.soundgif1.top+=i*vorzeichen
            document.soundgif1.left+=i*vorzeichen
            vorzeichen=vorzeichen*(-1)
            i--
            var timer=settimeout("shakesound()",50)
      }
      else {
            document.soundgif1.top=-400
            document.soundgif1.left=-400
            i=shakestrength
            cleartimeout(timer)
      }
   }
}

function makesound(soundobj){
    showsoundpic()
    var thissound= eval("document."+soundobj)
    thissound.play()
}

function handlermm(e){
    x = (document.layers) ? e.pagex : event.clientx
    y = (document.layers) ? e.pagey : event.clienty
}
if (document.layers){
    document.captureevents(event.mousemove);
}
document.onmousemove = handlermm;

// - end of javascript - -->
</script>
<div class=soundpic id=soundgif1><img height=300
src="http://www.jsshow.com/wytx/images/75/flash1611.gif" width=400> http://www.jsshow.com/wytx/images/75/flash1611.gif</div>

<div class=mainbody id=mainbody style="left: 265px; top: 17px"><a href="link.htm"
onmouseover="makesound('sound1')" target=_blank>鼠标移过来试试</a> </div>
<embed height=128 hidden=true name=sound1 src=http://www.jsshow.com/wytx/images/75/thunder1611.au width=128
mastersound autostart="false"></embed>
      










--------------------------------------

http://www.huoyue.com.cn 活跃网,活跃人群的论坛,访问活跃网,将给您带来意想不到的收获,还可以免费为您开论坛,让您免费拥有与朋友、网友交流的论坛。你是年轻人吗?你活跃你就上!
页: [1]
查看完整版本: ***按钮特效***打雷喽 下雨收衣服呀~~~~~