找回密码

碧海潮声大学生网

查看: 1518|回复: 8
打印 上一主题 下一主题

网页素材代码共享~

[复制链接]
跳转到指定楼层
1#
发表于 2005-12-18 03:28 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
最近正在做网站,一些代码没地方存,先放这~嘿嘿
大家谁有一些特效代码也共享下吧~~~~


飞舞的图片

红色的是图片地址,改成你需要的。

<div id="img" style="position:absolute;">
<a href="http://www.chinallhc.tk/">
<img src="" border="0"></a>
</div>
<script language="javascript">
<!--
var xPos = 20;
var yPos = document.body.clientHeight;
var step = 1;
var delay = 30;
var height = 0;
var Hoffset = 0;
var Woffset = 0;
var yon = 0;
var xon = 0;
var pause = true;
var interval;
img.style.top = yPos;
function changePos() {
width = document.body.clientWidth;
height = document.body.clientHeight;
Hoffset = img.offsetHeight;
Woffset = img.offsetWidth;
img.style.left = xPos + document.body.scrollLeft;
img.style.top = yPos + document.body.scrollTop;
if (yon) {
yPos = yPos + step;
}
else {
yPos = yPos - step;
}
if (yPos < 0) {
yon = 1;
yPos = 0;
}
if (yPos >= (height - Hoffset)) {
yon = 0;
yPos = (height - Hoffset);
}
if (xon) {
xPos = xPos + step;
}
else {
xPos = xPos - step;
}
if (xPos < 0) {
xon = 1;
xPos = 0;
}
if (xPos >= (width - Woffset)) {
xon = 0;
xPos = (width - Woffset);
}
}
function start() {
img.visibility = "visible";
interval = setInterval(&#39;changePos()&#39;, delay);
}
start();
// End -->
</script>
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 顶 踩
2#
 楼主| 发表于 2005-12-18 03:30 | 只看该作者
各种播放器代码
1.avi格式
代码片断如下:
<object id="video" width="400" height="200" border="0" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA">
<param name="ShowDisplay" value="0">
<param name="ShowControls" value="1">
<param name="AutoStart" value="1">
<param name="AutoRewind" value="0">
<param name="PlayCount" value="0">
<param name="Appearance value="0 value=""">
<param name="BorderStyle value="0 value=""">
<param name="MovieWindowHeight" value="240">
<param name="MovieWindowWidth" value="320">
<param name="FileName" value="file:///D|/work/vod/Mbar.avi">
<embed width="400" height="200" border="0" showdisplay="0" showcontrols="1" autostart="1" autorewind="0" playcount="0" moviewindowheight="240" moviewindowwidth="320" filename="file:///D|/work/vod/Mbar.avi" src="Mbar.avi">
</embed>
</object>


2.mpg格式
代码片断如下:
<object classid="clsid:05589FA1-C356-11CE-BF01-00AA0055595A" id="ActiveMovie1" width="239" height="250">
<param name="Appearance" value="0">
<param name="AutoStart" value="-1">
<param name="AllowChangeDisplayMode" value="-1">
<param name="AllowHideDisplay" value="0">
<param name="AllowHideControls" value="-1">
<param name="AutoRewind" value="-1">
<param name="Balance" value="0">
<param name="CurrentPosition" value="0">
<param name="DisplayBackColor" value="0">
<param name="DisplayForeColor" value="16777215">
<param name="DisplayMode" value="0">
<param name="Enabled" value="-1">
<param name="EnableContextMenu" value="-1">
<param name="EnablePositionControls" value="-1">
<param name="EnableSelectionControls" value="0">
<param name="EnableTracker" value="-1">
<param name="Filename" value="../../../mpeg/halali.mpg" valuetype="ref">
<param name="FullScreenMode" value="0">
<param name="MovieWindowSize" value="0">
<param name="PlayCount" value="1">
<param name="Rate" value="1">
<param name="SelectionStart" value="-1">
<param name="SelectionEnd" value="-1">
<param name="ShowControls" value="-1">
<param name="ShowDisplay" value="-1">
<param name="ShowPositionControls" value="0">
<param name="ShowTracker" value="-1">
<param name="Volume" value="-480">
</object>


3.smi格式
代码片断如下:
<OBJECT id=RVOCX classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA width=240
height=180>
<param name="_ExtentX" value="6350">
<param name="_ExtentY" value="4763">
<param name="AUTOSTART" value="-1">
<param name="SHUFFLE" value="0">
<param name="PREFETCH" value="0">
<param name="NOLABELS" value="-1">
<param name="SRC" value="rm.rm">
<param name="CONTROLS" value="ImageWindow">
<param name="CONSOLE" value="console1">
<param name="LOOP" value="0">
<param name="NUMLOOP" value="0">
<param name="CENTER" value="0">
<param name="MAINTAINASPECT" value="0">
<param name="BACKGROUNDCOLOR" value="#000000"><embed src="real.smi" type="audio/x-pn-realaudio-plugin" console="Console1" controls="ImageWindow" height="180" width="240" autostart="true"></OBJECT>


4.rm格式
代码片断如下:
<OBJECT ID=video1 CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" HEIGHT=288 WIDTH=352>

<param name="_ExtentX" value="9313">
<param name="_ExtentY" value="7620">
<param name="AUTOSTART" value="0">
<param name="SHUFFLE" value="0">
<param name="PREFETCH" value="0">
<param name="NOLABELS" value="0">
<param name="SRC" value="rtsp://203.207.131.35/vod/dawan-a.rm";;>
<param name="CONTROLS" value="ImageWindow">
<param name="CONSOLE" value="Clip1">
<param name="LOOP" value="0">
<param name="NUMLOOP" value="0">
<param name="CENTER" value="0">
<param name="MAINTAINASPECT" value="0">
<param name="BACKGROUNDCOLOR" value="#000000"><embed SRC type="audio/x-pn-realaudio-plugin" CONSOLE="Clip1" CONTROLS="ImageWindow" HEIGHT="288" WIDTH="352" AUTOSTART="false">
</OBJECT>


5.wmv格式
代码片断如下:
<object id="NSPlay" width=200 height=180 classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/act ... p2inf.cab#Version=6,4,5,715" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" align="right" hspace="5">
<!-- ASX File Name -->
<param name="AutoRewind" value=1>
<param name="FileName" value="******.wmv">
<!-- Display Controls -->

<param name="ShowControls" value="1">
<!-- Display Position Controls -->

<param name="ShowPositionControls" value="0">
<!-- Display Audio Controls -->

<param name="ShowAudioControls" value="1">
<!-- Display Tracker Controls -->

<param name="ShowTracker" value="0">
<!-- Show Display -->

<param name="ShowDisplay" value="0">
<!-- Display Status Bar -->

<param name="ShowStatusBar" value="0">
<!-- Diplay Go To Bar -->

<param name="ShowGotoBar" value="0">
<!-- Display Controls -->

<param name="ShowCaptioning" value="0">
<!-- Player Autostart -->

<param name="AutoStart" value=1>
<!-- Animation at Start -->

<param name="Volume" value="-2500">
<param name="AnimationAtStart" value="0">
<!-- Transparent at Start -->

<param name="TransparentAtStart" value="0">
<!-- Do not allow a change in display size -->

<param name="AllowChangeDisplaySize" value="0">
<!-- Do not allow scanning -->

<param name="AllowScan" value="0">
<!-- Do not show contect menu on right mouse click -->

<param name="EnableContextMenu" value="0">
<!-- Do not allow playback toggling on mouse click -->
<param name="ClickToPlay" value="0">
</object>



wma\\\\\
放在 <body> 里面。下面是部分解释:

<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" id="MediaPlayer1" >
<param name="Filename" value="1.Wma"> <!--你文件的位置-->
<param name="PlayCount" value="1"><!--控制重复次数: “x”为几重复播放几次; x=0,无限循环。-->
<param name="AutoStart" value="0"><!--控制播放方式: x=1,打开网页自动播放; x=0,按播放键播放。-->
<param name="ClickToPlay" value="1"><!--控制播放开关: x=1,可鼠标点击控制播放或暂停状态; x=0,禁用此功能。-->
<param name="DisplaySize" value="0"><!--控制播放画面: x=0,原始大小; x=1,一半大小; x=2,2倍大小。-->
<param name="EnableFullScreen Controls" value="1"><!--控制切换全屏: x=1,允许切换为全屏; x=0,禁用此功能。-->
<param name="ShowAudio Controls" value="1"><!--控制音量: x=1,允许调节音量; x=0,禁止音量调节。-->
<param name="EnableContext Menu" value="1"><!--控制快捷菜单: x=1,允许使用右键菜单; x=0,禁用右键菜单。-->
<param name="ShowDisplay" value="1"><!--控制版权信息: x=1,显示电影及作者信息;x=0,不显示相关信息-->
</object >
3#
 楼主| 发表于 2005-12-18 03:31 | 只看该作者
将你网页中的<body>改为下面的代码就能得到相应的鼠标特效了。

代码:

01   绿色<BODY style=&#39;cursor:url(http://images.jojoo.net/gif/mouse.cur)&#39;>
02  花树枝 <BODY style=&#39;cursor:url(http://yuhou.net/work/images/xw_answer/liujg_xw_answer_nor.cur)&#39;>
03   小点跟随<BODY style=&#39;cursor:url(http://yuhou.net/images/liujg_m030719.ani)&#39;>
04   粉红玫瑰<BODY style=&#39;cursor:url(http://yuhou.net/build/images/03.cur)&#39;>
05   钥匙<BODY style=&#39;cursor:url(http://asp.7i24.com/yhsjxe/book1/images/c.cur)&#39;>
06   小手<BODY style=&#39;cursor:url(http://asp.7i24.com/yhsjxe/book1/images/c2.cur)&#39;>
07   短笔<BODY style=&#39;cursor:url(http://asp.7i24.com/yhsjxe/links/01.cur)&#39;>
08   太阳花<BODY style=&#39;cursor:url(http://lssm.wx-e.com/images/lssm.ani)&#39;>
09   小色杆<BODY style=&#39;cursor:url(http://home.vipcp.net/kukumm/diary1/images/kuru2r.ani)&#39;>
10   绿色样式剪头<BODY style=&#39;cursor:url(http://lengku.net//index/mouse.ani)&#39;>
11   银色样式剪头<BODY style=&#39;cursor:url(http://nms.voline.net/aspsky/skins/dream/mouse.ani)&#39;>
12   小老鼠<BODY style=&#39;cursor:url(http://e.1asphost.com/xiayule/guest7/pic/1.ani)&#39;>
13   有点像猫<BODY style=&#39;cursor:url(http://asp2.6to23.com/whslj/lyb/pic/cur.ani)&#39;>
14   美女头像<BODY style=&#39;cursor:url(http://e.1asphost.com/xiayule/guest10/pic/cur.ani)&#39;>
15   小红鼠<BODY style=&#39;cursor:url(http://e.1asphost.com/xiayule/guest11/pic/cur.ani)&#39;>
16   小粉猪<BODY style=&#39;cursor:url(http://e.1asphost.com/xiayule/guest8/pic/cur.ani)&#39;>
17   小美女加小煎头<BODY style=&#39;cursor:url(http://e.1asphost.com/xiayule/guest12/pic/cur.ani)&#39;>
18   蝴蝶<BODY style=&#39;cursor:url(http://asp2.6to23.com/rlf/gb3/pic/cur.ani)&#39;>
19   小钟点样式<BODY style=&#39;cursor:url(http://asp2.6to23.com/peg3/clover3/pic/cur.ani)&#39;>
20   十字<BODY style=&#39;cursor:url(http://asp2.6to23.com/peg3/sky/pic/cross.ani)&#39;>
21   样式剪头<BODY style=&#39;cursor:url(http://asp2.6to23.com/peg3/sky/pic/cur.ani)&#39;>
22   银杆<BODY style=&#39;cursor:url(http://asp2.6to23.com/peg3/sd/pic/cur.cur)&#39;>
23   带头粉红杆<BODY style=&#39;cursor:url(http://asp2.6to23.com/peg3/sakura/pic/cur.ani)&#39;>
24   两十字<BODY style=&#39;cursor:url(http://www.bluenuo.com/gbbear/pic/cur.ani)&#39;>
25   兔头<BODY style=&#39;cursor:url(http://50net.com/book/img2/1.ani)&#39;>
26   螺旋<BODY style=&#39;cursor:url(http://50net.com/home/ani5.ani)&#39;>
27   花<BODY style=&#39;cursor:url(http://50net.com/forest/1.ico)&#39;>
28   花<BODY style=&#39;cursor:url(http://50net.com/forest/2.ico)&#39;>
29   动态小鼠<BODY style=&#39;cursor:url(http://www.kulongnvhai.com/free/pic/cur.ani)&#39;>
30   尾动灰色<BODY style=&#39;cursor:url(http://fhwep.lwang.net/Images/Wag3dg.ani)&#39;>
31   三角<BODY style=&#39;cursor:url(http://fhwep.lwang.net/Images/Wag3dw.ani)&#39;>



建议您将鼠标的样式文件下载后,上传到自己的网站上。免得无法显示。
也可以用下面的代码:
动态鼠标的插入
在<head>与</head>之间插入:
<style type=text/css>
a:hover {cursor:url(&#39;**.cur&#39;)}
BODY {cursor:url(&#39;**.cur&#39;)}
</style>

说明:

1、( )号中的为你的图标的路径,后缀名还有**.ico的,和**.ani的.

2、第一个路径是接触链接时的指针。第二个路径是鼠标移动时的指针。

后缀名为**.ico 的为静态
后缀名为**.cur 的为静态
后缀名为**.ani 的为动画
4#
 楼主| 发表于 2005-12-18 03:33 | 只看该作者
页面特效  勤劳的小蜜蜂采蜜中...  


要完成此效果需要两个步骤

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

<SCRIPT language=JavaScript>
function DynLayer(id,nestref,frame) {
   if (!is.ns5 && !DynLayer.set && !frame) DynLayerInit()
   this.frame = frame || self
   if (is.ns) {
      if (is.ns4) {
        if (!frame) {
           if (!nestref) var nestref = DynLayer.nestRefArray[id]
           if (!DynLayerTest(id,nestref)) return
           this.css = (nestref)? eval("document."+nestref+".document."+id) : document.layers[id]
        }
        else this.css = (nestref)? eval("frame.document."+nestref+".document."+id) : frame.document.layers[id]
        this.elm = this.event = this.css
        this.doc = this.css.document
      }
      else if (is.ns5) {
        this.elm = document.getElementById(id)
        this.css = this.elm.style
        this.doc = document
      }
      this.x = this.css.left
      this.y = this.css.top
      this.w = this.css.clip.width
      this.h = this.css.clip.height
   }
   else if (is.ie) {
      this.elm = this.event = this.frame.document.all[id]
      this.css = this.frame.document.all[id].style
      this.doc = document
      this.x = this.elm.offsetLeft
      this.y = this.elm.offsetTop
      this.w = (is.ie4)? this.css.pixelWidth : this.elm.offsetWidth
      this.h = (is.ie4)? this.css.pixelHeight : this.elm.offsetHeight
   }
   this.id = id
   this.nestref = nestref
   this.obj = id + "DynLayer"
   eval(this.obj + "=this")
}
function DynLayerMoveTo(x,y) {
   if (x!=null) {
      this.x = x
      if (is.ns) this.css.left = this.x
      else this.css.pixelLeft = this.x
   }
   if (y!=null) {
      this.y = y
      if (is.ns) this.css.top = this.y
      else this.css.pixelTop = this.y
   }
}
function DynLayerMoveBy(x,y) {
   this.moveTo(this.x+x,this.y+y)
}
function DynLayerShow() {
   this.css.visibility = (is.ns4)? "show" : "visible"
}
function DynLayerHide() {
   this.css.visibility = (is.ns4)? "hide" : "hidden"
}
DynLayer.prototype.moveTo = DynLayerMoveTo
DynLayer.prototype.moveBy = DynLayerMoveBy
DynLayer.prototype.show = DynLayerShow
DynLayer.prototype.hide = DynLayerHide
DynLayerTest = new Function(&#39;return true&#39;)
function DynLayerInit(nestref) {
   if (!DynLayer.set) DynLayer.set = true
   if (is.ns) {
      if (nestref) ref = eval(&#39;document.&#39;+nestref+&#39;.document&#39;)
      else {nestref = &#39;&#39;; ref = document;}
      for (var i=0; i<ref.layers.length; i++) {
        var divname = ref.layers.name
        DynLayer.nestRefArray[divname] = nestref
        var index = divname.indexOf("Div")
        if (index > 0) {
           eval(divname.substr(0,index)+&#39; = new DynLayer("&#39;+divname+&#39;","&#39;+nestref+&#39;")&#39;)
        }
        if (ref.layers.document.layers.length > 0) {
           DynLayer.refArray[DynLayer.refArray.length] = (nestref==&#39;&#39;)? ref.layers.name : nestref+&#39;.document.&#39;+ref.layers.name
        }
      }
      if (DynLayer.refArray.i < DynLayer.refArray.length) {
        DynLayerInit(DynLayer.refArray[DynLayer.refArray.i++])
      }
   }
   else if (is.ie) {
      for (var i=0; i<document.all.tags("DIV").length; i++) {
        var divname = document.all.tags("DIV").id
        var index = divname.indexOf("Div")
        if (index > 0) {
           eval(divname.substr(0,index)+&#39; = new DynLayer("&#39;+divname+&#39;")&#39;)
        }
      }
   }
   return true
}
DynLayer.nestRefArray = new Array()
DynLayer.refArray = new Array()
DynLayer.refArray.i = 0
DynLayer.set = false
function DynLayerSlideTo(endx,endy,inc,speed,fn) {
   if (endx==null) endx = this.x
   if (endy==null) endy = this.y
   var distx = endx-this.x
   var disty = endy-this.y
   this.slideStart(endx,endy,distx,disty,inc,speed,fn)
}
function DynLayerSlideBy(distx,disty,inc,speed,fn) {
   var endx = this.x + distx
   var endy = this.y + disty
   this.slideStart(endx,endy,distx,disty,inc,speed,fn)
}
function DynLayerSlideStart(endx,endy,distx,disty,inc,speed,fn) {
   if (this.slideActive) return
   if (!inc) inc = 10
   if (!speed) speed = 20
   var num = Math.sqrt(Math.pow(distx,2) + Math.pow(disty,2))/inc
   if (num==0) return
   var dx = distx/num
   var dy = disty/num
   if (!fn) fn = null
   this.slideActive = true
   this.slide(dx,dy,endx,endy,num,1,speed,fn)
}
function DynLayerSlide(dx,dy,endx,endy,num,i,speed,fn) {
   if (!this.slideActive) return
   if (i++ < num) {
      this.moveBy(dx,dy)
      this.onSlide()
      if (this.slideActive) setTimeout(this.obj+".slide("+dx+","+dy+","+endx+","+endy+","+num+","+i+","+speed+",\""+fn+"\")",speed)
      else this.onSlideEnd()
   }
   else {
      this.slideActive = false
      this.moveTo(endx,endy)
      this.onSlide()
      this.onSlideEnd()
      eval(fn)
   }
}
function DynLayerSlideInit() {}
DynLayer.prototype.slideInit = DynLayerSlideInit
DynLayer.prototype.slideTo = DynLayerSlideTo
DynLayer.prototype.slideBy = DynLayerSlideBy
DynLayer.prototype.slideStart = DynLayerSlideStart
DynLayer.prototype.slide = DynLayerSlide
DynLayer.prototype.onSlide = new Function()
DynLayer.prototype.onSlideEnd = new Function()
function DynLayerClipInit(clipTop,clipRight,clipBottom,clipLeft) {
   if (is.ie) {
      if (arguments.length==4) this.clipTo(clipTop,clipRight,clipBottom,clipLeft)
      else if (is.ie4) this.clipTo(0,this.css.pixelWidth,this.css.pixelHeight,0)
   }
}
function DynLayerClipTo(t,r,b,l) {
   if (t==null) t = this.clipValues(&#39;t&#39;)
   if (r==null) r = this.clipValues(&#39;r&#39;)
   if (b==null) b = this.clipValues(&#39;b&#39;)
   if (l==null) l = this.clipValues(&#39;l&#39;)
   if (is.ns) {
      this.css.clip.top = t
      this.css.clip.right = r
      this.css.clip.bottom = b
      this.css.clip.left = l
   }
   else if (is.ie) this.css.clip = "rect("+t+"px "+r+"px "+b+"px "+l+"px)"
}
function DynLayerClipBy(t,r,b,l) {
   this.clipTo(this.clipValues(&#39;t&#39;)+t,this.clipValues(&#39;r&#39;)+r,this.clipValues(&#39;b&#39;)+b,this.clipValues(&#39;l&#39;)+l)
}
function DynLayerClipValues(which) {
   if (is.ie) var clipv = this.css.clip.split("rect(")[1].split(")")[0].split("px")
   if (which=="t") return (is.ns)? this.css.clip.top : Number(clipv[0])
   if (which=="r") return (is.ns)? this.css.clip.right : Number(clipv[1])
   if (which=="b") return (is.ns)? this.css.clip.bottom : Number(clipv[2])
   if (which=="l") return (is.ns)? this.css.clip.left : Number(clipv[3])
}
DynLayer.prototype.clipInit = DynLayerClipInit
DynLayer.prototype.clipTo = DynLayerClipTo
DynLayer.prototype.clipBy = DynLayerClipBy
DynLayer.prototype.clipValues = DynLayerClipValues
function DynLayerWrite(html) {
   if (is.ns) {
      this.doc.open()
      this.doc.write(html)
      this.doc.close()
   }
   else if (is.ie) {
      this.event.innerHTML = html
   }
}
DynLayer.prototype.write = DynLayerWrite
function BrowserCheck() {
   var b = navigator.appName
   if (b=="Netscape") this.b = "ns"
   else if (b=="Microsoft Internet Explorer") this.b = "ie"
   else this.b = b
   this.version = navigator.appVersion
   this.v = parseInt(this.version)
   this.ns = (this.b=="ns" && this.v>=4)
   this.ns4 = (this.b=="ns" && this.v==4)
   this.ns5 = (this.b=="ns" && this.v==5)
   this.ie = (this.b=="ie" && this.v>=4)
   this.ie4 = (this.version.indexOf(&#39;MSIE 4&#39;)>0)
   this.ie5 = (this.version.indexOf(&#39;MSIE 5&#39;)>0)
   this.min = (this.ns||this.ie)
}
is = new BrowserCheck()
function css(id,left,top,width,height,color,vis,z,other) {
   if (id=="START") return &#39;<STYLE TYPE="text/css">\n&#39;
   else if (id=="END") return &#39;</STYLE>&#39;
   var str = (left!=null && top!=null)? &#39;#&#39;+id+&#39; {position:absolute; left:&#39;+left+&#39;px; top:&#39;+top+&#39;px;&#39; : &#39;#&#39;+id+&#39; {position:relative;&#39;
   if (arguments.length>=4 && width!=null) str += &#39; width:&#39;+width+&#39;px;&#39;
   if (arguments.length>=5 && height!=null) {
      str += &#39; height:&#39;+height+&#39;px;&#39;
      if (arguments.length<9 || other.indexOf(&#39;clip&#39;)==-1) str += &#39; clip:rect(0px &#39;+width+&#39;px &#39;+height+&#39;px 0px);&#39;
   }
   if (arguments.length>=6 && color!=null) str += (is.ns)? &#39; layer-background-color:&#39;+color+&#39;;&#39; : &#39; background-color:&#39;+color+&#39;;&#39;
   if (arguments.length>=7 && vis!=null) str += &#39; visibility:&#39;+vis+&#39;;&#39;
   if (arguments.length>=8 && z!=null) str += &#39; z-index:&#39;+z+&#39;;&#39;
   if (arguments.length==9 && other!=null) str += &#39; &#39;+other
   str += &#39;}\n&#39;
   return str
}
function writeCSS(str,showAlert) {
   str = css(&#39;START&#39;)+str+css(&#39;END&#39;)
   document.write(str)
   if (showAlert) alert(str)
}
</SCRIPT>
<SCRIPT language=JavaScript>
function Drag() {
   this.obj = null
   this.array = new Array()
   this.dropTargets = new Array()
   this.active = false
   this.offsetX = 0
   this.offsetY = 0
   this.zIndex = 0
   this.resort = true
   this.add = DragAdd
   this.addTargets = DragAddTargets
   this.checkTargets = DragCheckTargets
   this.targetHit == null
   this.remove = DragRemove
   this.setGrab = DragSetGrab
   this.mouseDown = DragMouseDown
   this.mouseMove = DragMouseMove
   this.mouseUp = DragMouseUp
   this.onDragStart = new Function()
   this.onDragMove = new Function()
   this.onDragEnd = new Function()
   this.onDragDrop = new Function()
}
function DragAdd() {
   for (var i=0; i<arguments.length; i++) {
      var l = this.array.length
      this.array[l] = arguments
      this.array[l].dragGrab = new Array(0,this.array[l].w,this.array[l].h,0)
      this.zIndex += 1
   }
}
function DragAddTargets() {
   for (var i=0; i<arguments.length; i++) {
      var l = this.dropTargets.length
      this.dropTargets[l] = arguments
      this.dropTargets[l].dragGrab = new Array(0,this.dropTargets[l].w,this.dropTargets[l].h,0)
   }
}
function DragSetGrab(dynlayer,top,right,bottom,left) {
   dynlayer.dragGrab = new Array(top,right,bottom,left)
}
function DragRemove() {
   for (var i=0; i<arguments.length; i++) {
      for (var j=0; j<this.array.length; j++) {
        if (this.array[j]==arguments) {
           for (var k=j;k<=this.array.length-2;k++) this.array[k] = this.array[k+1]
           this.array[this.array.length-1] = null
           this.array.length -= 1
           break
        }
      }
   }
}
function DragMouseDown(x,y) {
   for (var i=this.array.length-1;i>=0;i--) {
      var lyr = this.array
      if (checkWithinLayer(x,y,lyr)) {
        this.obj = this.array
        this.offsetX = x-this.obj.x
        this.offsetY = y-this.obj.y
        this.active = true
        break
      }
   }
   if (!this.active) return false
   else {
      if (this.resort) {
        this.obj.css.zIndex = this.zIndex++
        for (var j=i;j<=this.array.length-2;j++) this.array[j] = this.array[j+1]
        this.array[this.array.length-1] = this.obj
      }
      this.onDragStart(x,y)
      return true
   }
}
function DragMouseMove(x,y) {
   if (!this.active) return false
   else {
      this.obj.moveTo(x-this.offsetX,y-this.offsetY)
      this.onDragMove(x,y)
      return true
   }
}
function DragMouseUp(x,y) {
   if (!this.active) return false
   else {
      this.active = false
      if (this.checkTargets()) this.onDragDrop()
      this.onDragEnd(x,y)
      return true
   }
}
function DragCheckTargets() {
   for (i in this.dropTargets) {
      var lyr = this.dropTargets
      if (checkWithinLayer(lyr.x,lyr.y,this.obj) ||
      checkWithinLayer(lyr.x+lyr.w,lyr.y,this.obj) ||
      checkWithinLayer(lyr.x,lyr.y+lyr.h,this.obj) ||
      checkWithinLayer(lyr.x+lyr.w,lyr.y+lyr.h,this.obj) ||
      checkWithinLayer(this.obj.x,this.obj.y,lyr) ||
      checkWithinLayer(this.obj.x+this.obj.w,this.obj.y,lyr) ||
      checkWithinLayer(this.obj.x,this.obj.y+this.obj.h,lyr) ||
      checkWithinLayer(this.obj.x+this.obj.w,this.obj.y+this.obj.h,lyr)) {
        this.targetHit = lyr
        return true
      }
   }
   return false
}

function checkWithin(x,y,left,right,top,bottom) {
   if (x>=left && x<right && y>=top && y<bottom) return true
   else return false
}
function checkWithinLayer(x,y,lyr) {
   if (checkWithin(x,y,lyr.x+lyr.dragGrab[3],lyr.x+lyr.dragGrab[1],lyr.y+lyr.dragGrab[0],lyr.y+lyr.dragGrab[2])) return true
   else return false
}

drag = new Drag()
</SCRIPT>
<SCRIPT language=JavaScript>
<!--
for (var i=0;i<=4;i++) {
   eval("bee_r"+i+" = new Image()")
   eval("bee_r"+i+".src = &#39;../txtx/images/115/bee-r"+i+".gif&#39;")
   eval("bee_l"+i+" = new Image()")
   eval("bee_l"+i+".src = &#39;../txtx/images/115/bee-l"+i+".gif&#39;")
}
function init() {
   flower1 = new DynLayer(&#39;flower1Div&#39;)
   bee1 = new Bee(&#39;bee1Bee&#39;,null,flower1)
  
   drag.resort = false
   drag.add(flower1)

   document.onmousedown = mouseDown
   document.onmousemove = mouseMove
   document.onmouseup = mouseUp
   if (is.ns) document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP)
}
function mouseDown(e) {
   if ((is.ns && e.which!=1) || (is.ie && event.button!=1)) return true
   var x = (is.ns)? e.pageX : event.x+document.body.scrollLeft
   var y = (is.ns)? e.pageY : event.y+document.body.scrollTop
   if (drag.mouseDown(x,y)) {
      return false
   }
   else return true
}
function mouseMove(e) {
   var x = (is.ns)? e.pageX : event.x+document.body.scrollLeft
   var y = (is.ns)? e.pageY : event.y+document.body.scrollTop
   if (drag.mouseMove(x,y)) {
      bee1.startFly()
      return false
   }
   else return true
}
function mouseUp(e) {
   var x = (is.ns)? e.pageX : event.x+document.body.scrollLeft
   var y = (is.ns)? e.pageY : event.y+document.body.scrollTop
   if (drag.mouseUp()) {
      return false
   }
   else return true
}
function Bee(id,nestref,flower) {
   this.dynlayer = DynLayer
   this.dynlayer(id,nestref)
   this.i1 = new DynLayer(id+&#39;i1&#39;,id)
   this.i2 = new DynLayer(id+&#39;i2&#39;,id)
   this.flower = flower
   this.flyactive = false
   this.animactive = false
   this.animcount = 0
   this.direction = "r"
   this.animdir = 1
   this.amplitude = 35
   this.angleinc = 10
   this.hoverangle = 0
   this.centerX = this.x
   this.centerY = this.y
   this.startFly = BeeStartFly
   this.fly = BeeFly
   this.animate = BeeAnimate
   this.land = BeeLand
}
Bee.prototype = DynLayer.prototype
function BeeStartFly() {
   if (!this.flyactive) {
      var distx = Math.abs(this.x+8-this.flower.x)
      var disty = Math.abs(this.y+8-this.flower.y)
      if (Math.sqrt(Math.pow(distx,2)+Math.pow(disty,2)) > 35) {
        this.slideActive = false
        this.animactive = true
        this.animate()
        this.flyactive = true
        this.fly()
      }
   }
}
function BeeFly() {
   if (this.flyactive) {
      var distx = Math.abs(this.x+8-this.flower.x)
      var disty = Math.abs(this.y+8-this.flower.y)
      if (Math.sqrt(Math.pow(distx,2)+Math.pow(disty,2)) > 40 || distx > 15) {
        var angle = Math.floor(Math.atan(disty/distx)*180/Math.PI)
        if (distx==0 && disty==0) angle = 0
        if (this.flower.x>=this.x+8) {
           if (this.flower.y<=this.y+8) angle = angle   // 0 to 90
           else angle = 360-angle           // 270 to 360
           this.direction = "r"
        }
        else {
           if (this.flower.y<=this.y+8) angle = 180-angle   // 90 to 180
           else angle = 180+angle        // 180 to 270
           this.direction = "l"
        }
        this.centerX += 3*Math.cos(angle*Math.PI/180)
        this.centerY -= 3*Math.sin(angle*Math.PI/180)
        this.hoverangle += this.angleinc
        this.moveTo(this.centerX,this.centerY-this.amplitude*Math.sin(this.hoverangle*Math.PI/180))
        setTimeout(this.obj+&#39;.fly()&#39;,20)
      }
      else {
        this.flyactive = false
        this.slideTo(this.flower.x+3,this.flower.y-5,2,20,this.obj+".land()")
      }
   }
}
function BeeAnimate() {
   if (this.animactive) {
      this.i1.doc.images[this.id+&#39;i1Img&#39;].src = eval(&#39;bee_&#39;+this.direction+Math.floor(5*Math.random())+&#39;.src&#39;)
      this.i2.doc.images[this.id+&#39;i2Img&#39;].src = eval(&#39;bee_&#39;+this.direction+Math.floor(5*Math.random())+&#39;.src&#39;)
      setTimeout(this.obj+&#39;.animate()&#39;,20)
   }
}
function BeeLand() {
   this.centerX = this.x
   this.centerY = this.y
   this.hoverangle = 0
   if (!this.flyactive) {
      this.i1.doc.images[this.id+&#39;i1Img&#39;].src = bee_r1.src
      this.i2.doc.images[this.id+&#39;i2Img&#39;].src = bee_r1.src
      this.animactive = 0
   }
}
//-->
</SCRIPT>
<STYLE type=text/css>#bee1Bee {   LEFT: 100px; WIDTH: 16px; POSITION: absolute; TOP: 100px; HEIGHT: 16px}#bee1Beei1 {   LEFT: 0px; WIDTH: 16px; POSITION: absolute; TOP: 0px; HEIGHT: 16px}#bee1Beei2 {   LEFT: 0px; WIDTH: 16px; POSITION: absolute; TOP: 0px; HEIGHT: 16px}#flower1Div {   LEFT: 120px; WIDTH: 45px; POSITION: absolute; TOP: 120px; HEIGHT: 72px}</STYLE><DIV id=flower1Div><IMG height=72 src="../ts/pic/flower.gif" width=45></DIV><DIV id=bee1Bee><DIV id=bee1Beei1><IMG height=16 src="../ts/pic/bee.gif" width=16 name=bee1Beei1Img></DIV><DIV id=bee1Beei2><IMG height=16 src="../ts/pic/bee.gif" width=16 name=bee1Beei2Img></DIV></DIV>

第二步:把“onload=init()”<body>标记里
例如:<body onload=init()>
5#
 楼主| 发表于 2005-12-18 03:34 | 只看该作者
页面抖动警告
要完成此效果把如下代码加入到<body>区域中

<SCRIPT language=JavaScript1.2>
<!--
function boom(n) {
if (window.top.moveBy) {
for (i = 10; 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)
}
-->
</SCRIPT>
<A href="#" onmouseover="javascript:callJS(&#39;boom(3)&#39;);">
          <IMG border=0 src="../img/logo.gif"></A><SCRIPT language=JavaScript1.2>
<!--
function boom(n) {
if (window.top.moveBy) {
for (i = 10; 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)
}
-->
</SCRIPT>
<A href="#" onmouseover="javascript:callJS(&#39;boom(3)&#39;);">
          <IMG border=0 src="../img/logo.gif"></A><SCRIPT language=JavaScript1.2>
<!--
function boom(n) {
if (window.top.moveBy) {
for (i = 10; 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)
}
-->
</SCRIPT>
<A href="#" onmouseover="javascript:callJS(&#39;boom(3)&#39;);">
          <IMG border=0 src="../img/logo.gif"></A><SCRIPT language=JavaScript1.2>
<!--
function boom(n) {
if (window.top.moveBy) {
for (i = 10; 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)
}
-->
</SCRIPT>
<A href="#" onmouseover="javascript:callJS(&#39;boom(3)&#39;);">
          <IMG border=0 src="../img/logo.gif"></A><SCRIPT language=JavaScript1.2>
<!--
function boom(n) {
if (window.top.moveBy) {
for (i = 10; 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)
}
-->
</SCRIPT>
<A href="#" onmouseover="javascript:callJS(&#39;boom(3)&#39;);">
          <IMG border=0 src="../img/logo.gif"></A><SCRIPT language=JavaScript1.2>
<!--
function boom(n) {
if (window.top.moveBy) {
for (i = 10; 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)
}
-->
</SCRIPT>
<A href="#" onmouseover="javascript:callJS(&#39;boom(3)&#39;);">
          <IMG border=0 src="../img/logo.gif"></A><SCRIPT language=JavaScript1.2>
<!--
function boom(n) {
if (window.top.moveBy) {
for (i = 10; 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)
}
-->
</SCRIPT>
<A href="#" onmouseover="javascript:callJS(&#39;boom(3)&#39;);">
          <IMG border=0 src="../img/logo.gif"></A><SCRIPT language=JavaScript1.2>
<!--
function boom(n) {
if (window.top.moveBy) {
for (i = 10; 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)
}
-->
</SCRIPT>
<A href="#" onmouseover="javascript:callJS(&#39;boom(3)&#39;);">
          <IMG border=0 src=""></A>
6#
 楼主| 发表于 2005-12-18 03:36 | 只看该作者
禁止图片下载的脚本
把如下代码加入<body>区域中
<A HREF="javascript:void(0)" onMouseover="alert(&#39;对不起,图片不能随便下载!&#39;)"><IMG SRC="j2.gif" tppabs="" Align="center" Border="0" width="99" height="50"></A>
7#
 楼主| 发表于 2005-12-18 03:37 | 只看该作者
图片和文字同时向左滚动的Javascript代码<BODY>
<SCRIPT language=JavaScript1.2>
<!--

var sliderwidth=400
var sliderheight=120
var slidespeed=5

var leftrightslide=new Array()
var finalslide=&#39;&#39;

leftrightslide[0]=&#39;<a href="http://chinaluoyang.net/" target="_blank">中国洛阳</a>&#39;
leftrightslide[1]=&#39;<a href="http://chinaluoyang.net/" target="_blank"><img title=""  src="" border=0></a>&#39;
leftrightslide[2]=&#39;<a href="http://chinaluoyang.net" target="_blank"><img title=""  src="" border=0></a>&#39;


//copy contents of leftrightslide into one variable
for (i=0;i<leftrightslide.length;i++)
finalslide=finalslide+leftrightslide+"  "


if (document.all){
//dynamically write out the marquee tag
document.write(&#39;<marquee id="ieslider" scrollAmount=0 style="width:&#39;+sliderwidth+&#39;">&#39;+finalslide+&#39;</marquee>&#39;)
//stop marquee when mouse is over it
ieslider.onmouseover=new Function("ieslider.scrollAmount=0")
//re-enable marquee when mouse is out
ieslider.onmouseout=new Function("if (document.readyState==&#39;complete&#39;) ieslider.scrollAmount=slidespeed")
}

function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
document.ns_slider01.visibility="show"
setTimeout("window.onresize=regenerate",450)
intializeleftrightslide()
}
if (document.all)
ieslider.scrollAmount=slidespeed
}

//NS specific function for initializing slider upon page load
function intializeleftrightslide(){
document.ns_slider01.document.ns_slider02.document.write(&#39;<nobr>&#39;+finalslide+&#39;</nobr>&#39;)
document. ns_slider01.document.ns_slider02.document.close()
thelength=document.ns_slider01.document.ns_slider02.document.width
scrollslide()
}

//NS specific function for sliding slideshow
function scrollslide(){
if (document.ns_slider01.document.ns_slider02.left>=thelength*(-1)){
document.ns_slider01.document.ns_slider02.left-=slidespeed
setTimeout("scrollslide()",100)
}
else{
document.ns_slider01.document.ns_slider02.left=sliderwidth
scrollslide()
}
}
window.onload=regenerate2

//-->
</SCRIPT>
</BODY>
8#
 楼主| 发表于 2005-12-18 03:39 | 只看该作者
国际顶级域名免费申请。www.***.tk
申请步骤:
http://www.dot.tk/
右边方框
Find your domain name now!
这里输入你要申请的 .tk
点击OK
如果已经被人申请
第二步会叫你选择一个其他的
——————
还未被申请:
——————
下面绿色字体:
Type of registration

Please select your registration
FREE DOMAIN NAME(选择这个)
Dot tk paid registration

Where do you live?
Please select the country where you live
在下面选择国家CHINA
点击continue
_______________
下一页
————————
依次填写
你的转入地址
你的网站介绍
网站分类(随便选)
网站语言(默认为english,我选择chinese)
点击continue
————————
下一页
————————
连着的8格要你输入你网站的关键字
QQ2000每个都是输入laiwanglin通过
当然,你可以输入你主页的关键字
接下来依次:
随便选
下面的空格要你写入你在下面图片看见的文字!!
点击continue
________________
下一页
________________
依次:
名字
地址
邮编
城市
省份
电话号码(填写正确的位数)
传真号码(填写正确的位数)
性别
年龄
职业
你的邮箱(请填写正确的邮箱!!QQ2000用了263的邮箱没有收到确认信!!用163.com的邮箱或hotmail成功!)
密码
重复密码
方框打勾
点击continue
____________
申请成功!!
____________
马上收到信
收到信内容如下
____________

Malo ni!
and thank you (faka fetai)
for registering with Dot tk!

Your e-mail address : 6284578@163.com
password: ***********

confirmation code: tk2285355
(please note: this is not your password)

As you know we like to keep things simple, so all you need
to do to activate your Dot tk address is...

1. Go to http://my.dot.tk/cgi-bin/confirm.taloha?tk=4201410

2. Enter your confirmation code

If you have received this email, but did not join us @ Dot tk,
then somebody tried to register using your e-mail address.

In thase case, you can simply ignore this message... But why not come on in,
and see for yourself if your own -free- domain name is still
available at http://www.dot.tk

Any questions? Please visit our feedback page at
http://www.dot.tk/cgi-bin/response.taloha
Hope to see you soon at Dot tk.

Dot tk -- Dividing Domains Differently.

演示
http://www.qq2000.tk/

tk域名去广告方法
首先打开http://my.dot.tk/cgi-bin/login01.taloha,用你的TK账号登陆,在左边找到Dot TK Linker Promo这个选项,进去后在下面的Please select your Dot tk domain name中选择你要修改你玉米,点下一步。
里面一个有3个选项,选这个 No, thanks, I don&#39;t want to have a banner on my website. I am not interested in being selected for a review on Dot TK&#39;s website or a great Dot TK Polo Shirt. 就可以了。然后按最下面确认。大约几分钟你的tk玉米就没广告了。
演示:http://www.qq2000.tk

设置自己域名邮箱方法:(转发邮箱)
登陆后选择:Dot tk Email

选择自己的域名,下一步

Your (new) virtual address:你要建立的邮箱
...to be forwarded to email address: 你要转向的邮箱

确定。
9#
发表于 2005-12-21 13:32 | 只看该作者
呵呵....不错,不过这些代码在网上很多的...................
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋| 碧海潮声大学生网  

Copyright © 2001-2013 Comsenz Inc.   All Rights Reserved.

Powered by Discuz! X3.2( 浙ICP备11026473号 )

快速回复 返回顶部 返回列表