上一页  1   2    3     4     5     6   7    8       下一页

 

图像特效代码6

Sat

28

Feb

2009

180、图形循环渐显脚本

180、图形循环渐显脚本

脚本说明:

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

<img src="image1.gif" name="u" border=0

alt="Image" style="filter:alpha(opacity=0)">

<script language="JavaScript">

 

var b = 1;

var c = true;

 

function fade(){

if(document.all);

 

if(c == true) {

b++;

}

if(b==100) {

b--;

c = false

}

 

if(b==10) {

b++;

c = true;

}

 

if(c == false) {

b--;

}

u.filters.alpha.opacity=0 + b;

setTimeout("fade()",50);

}

</script>

 

 

第二步:<body>区域改为

<body bgcolor="#fef4d9" onLoad="fade()">

 

0 Comments

Sat

28

Feb

2009

179、图形左右晃动脚本

179、图形左右晃动脚本

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript">

<!--

 

step = 0;

obj = new Image();

 

function anim(xp,xk,smer) //smer = direction

{

 obj.style.left = x;

 

 x += step*smer;

 

 if (x>=(xk+xp)/2) {

    if (smer == 1) step--;

       else step++;

    }

 else {

    if (smer == 1) step++;

       else step--;

    }

 

 if (x >= xk) {

       x = xk;

       smer = -1;

      }

 

  if (x <= xp) {

       x = xp;

       smer = 1;

      }

// if (smer > 2) smer = 3;

  setTimeout('anim('+xp+','+xk+','+smer+')', 50);

}

 

 

function moveLR(objID,movingarea_width,c)

{

 

  if (navigator.appName=="Netscape") window_width = window.innerWidth;

     else window_width = document.body.offsetWidth;

 

  obj = document.images[objID];  

  image_width = obj.width;

 

  x1 = obj.style.left;

  x = Number(x1.substring(0,x1.length-2));   // 30px -> 30

 

  if (c == 0) {

 

          if (movingarea_width == 0) {

                   right_margin = window_width - image_width;

               anim(x,right_margin,1);

                     }                  

           else {

                  right_margin = x + movingarea_width - image_width;

                     if (movingarea_width < x + image_width) window.alert("No space for moving!");

                       else anim(x,right_margin,1);

              }

   }

   else {

       if (movingarea_width == 0) right_margin = window_width - image_width;

                else {

 

                   x = Math.round((window_width-movingarea_width)/2);

                      right_margin = Math.round((window_width+movingarea_width)/2)-image_width;

               }

              anim(x,right_margin,1);

   }         

}

 

 

//-->

</SCRIPT>

 

 

 

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

<img src="image1.gif" width=205 height=56 name="picture" style='position: absolute; top: 10px; left: 30px;' BORDER=0>

<SCRIPT LANGUAGE="JavaScript">

<!--

  setTimeout("moveLR('picture',300,1)",10);

//-->

</SCRIPT>

 

0 Comments

Sat

28

Feb

2009

178、图形选择脚本

178、图形选择脚本

脚本说明:

 

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

 

<SCRIPT LANGUAGE="JavaScript">

 

<!--

 

image1= new Image();

 

image1.src = "image1.gif";

 

image2= new Image();

 

image2.src = "image2.gif";

 

image3= new Image();

 

image3.src = "image3.gif";

 

 

 

function imgchange(){

 

       var imageNum =  document.form.selImage.selectedIndex + 1;

 

       fname = eval("image" + imageNum + ".src")

 

       document.img.src = fname

 

}

 

//-->

 

</SCRIPT>

 

 

 

 

 

 

 

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

 

<FORM name="form">

 

<SELECT NAME="selImage" size=1>

 

<OPTION>Image 1

 

<OPTION>Image 2

 

<OPTION>Image 3

 

</SELECT>

 

<INPUT type="button" value="View" onClick="imgchange()">

 

</FORM>

 

<IMG SRC="image1.gif" NAME="img">

 

 

0 Comments

Sat

28

Feb

2009

177、图片翻滚导航

177、图片翻滚导航

脚本说明:

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

<script>

<!--//

 

//定义图片的宽度和高度,所有的图片要有相同的尺寸;

var imgwidth=400

var imgheight=60

 

//下面定义了包含2个图片的数组,数组的下标从0开始,你可以增加任意的图片,按照顺序增加即可,注意相应增加数组下标。

var imgname=new Array()

imgname[0]="imggum1.jpg"

imgname[1]="imggum2.jpg"

 

//下面定义图片的url,如果不需要url,将连接值设置为"#"

var imgurl=new Array()

 

imgurl[0]="http://java2000.126.com"

imgurl[1]="#"

 

// 先预读图片,不要修改这里;

var imgpreload=new Array()

for (i=0;i<=imgname.length-1;i++) {

       imgpreload[i]=new Image()

       imgpreload[i].src=imgname[i]

}

 

 

var pause=2000

 

//图片的显示速度,数值小速度快;

var speed=20

 

//下面的参数也会影响图片显示的速度,数值小速度快;代表2个图片的显示间隔。

var step=10

 

//不要修改下面的代码;

var i_loop=0

var i_image=0

 

function stretchimage() {

       if (i_loop<=imgwidth) {

              if (document.all) {

                     imgcontainer.innerHTML="<a href='"+imgurl[i_image]+"' target='_blank'><img width='"+i_loop+"' height='"+imgheight+"' src='"+imgname[i_image]+"' border='0'></a>"

              }

              i_loop=i_loop+step

              var timer=setTimeout("stretchimage()",speed)

      }

       else {

              i_loop=imgwidth

              clearTimeout(timer)

              imgcontainer.innerHTML="<a href='"+imgurl[i_image]+"' target='_blank'><img src='"+imgname[i_image]+"' border='0'></a>"

              var timer=setTimeout("shrinkimage()",pause)

       }

}

 

function shrinkimage() {

       if (i_loop>=0) {

              if (document.all) {

                     imgcontainer.innerHTML="<a href='"+imgurl[i_image]+"' target='_blank'><img width='"+i_loop+"' height='"+imgheight+"' src='"+imgname[i_image]+"' border='0'></a>"

              }

              i_loop=i_loop-step

              var timer=setTimeout("shrinkimage()",speed)

      }

       else {

              i_loop=0

              clearTimeout(timer)

              changeimage()

       }

}

 

function changeimage() {

       i_image++

       if (i_image>=imgname.length) {i_image=0}

       if (document.layers) {

              document.imgcontainer.document.write("<a href='"+imgurl[i_image]+"' target='_blank'><img src='"+imgname[i_image]+"' border='0'></a>")  

              document.imgcontainer.document.close()

       }           

     stretchimage()

}

 

 

// -->

</script>

<style>

.containerstyle {

       position:absolute;

       left:100px;

       top:10px;

}

</style>

 

 

 

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

<span id="imgcontainer" class="containerstyle"></span>

 

 

第三步:<body>区中的内容发言为:

<body bgcolor="#fef4d9" onLoad="stretchimage()">

0 Comments

Sat

28

Feb

2009

176、图片定期消失

176、图片定期消失

脚本说明:

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

<script LANGUAGE="JavaScript">

<!--

function isnew(maxdays, addDate){

 

    var oldDate = new Date(addDate);

    var newDate = new Date();

    var maxdaysold = maxdays*24*60*60*1000;

    var psj=0;

   

    if ((newDate.getTime()-oldDate.getTime()) <= maxdaysold) {

        document.write("<img src=pic.jpg width=400 height=40 ALIGN=MIDDLE Alt='New'>");

    }

 

}

//-->

</script>

<script LANGUAGE="JavaScript">

<!--

isnew(7,"05/14/2000")

//-->

</script>

0 Comments

Sat

28

Feb

2009

175、图片响应鼠标变换

175、图片响应鼠标变换

脚本说明:

 

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

 

<center>

 

<SCRIPT LANGUAGE="JavaScript">

 

<!-- Begin

 

var rand1 = 0;

 

var useRand = 0;

 

 

 

images = new Array;

 

images[1] = new Image();

 

images[1].src = "image1.gif";

 

images[2] = new Image();

 

images[2].src = "image2.gif";

 

images[3] = new Image();

 

images[3].src = "image3.gif";

 

images[4] = new Image();

 

images[4].src = "image4.gif";

 

 

 

 

 

function swapPic() {

 

var imgnum = images.length - 1;

 

do {

 

var randnum = Math.random();

 

rand1 = Math.round((imgnum - 1) * randnum) + 1;

 

} while (rand1 == useRand);

 

useRand = rand1;

 

document.randimg.src = images[useRand].src;

 

}

 

//  End -->

 

</script>

 

<a onClick="swapPic();"><img name="randimg" src="image1.gif"></a><br>

 

<font face="Verdana" size="-2">click image to change</font>

 

</center>

 

 

 

第二步:<body>区域中内容改为:

 

<body bgcolor="#fef4d9" OnLoad="swapPic()">

 

 

0 Comments

Sat

28

Feb

2009

174、图片随意移动

174、图片随意移动

脚本说明:

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

<style type="text/css">

       #plane1 {position:absolute; left:290; top:170; width:121; z-index:0}

       #plane2 {position:absolute; left:400; top:250; width:118; z-index:0}

</style>

<SCRIPT LANGUAGE="JavaScript">

//Modified by the CoffeeCup HTML Editor++

//http://www.coffeecup.com

// Global variables for platform branching

var isNav, isIE

if (parseInt(navigator.appVersion) >= 4) {

       if (navigator.appName == "Netscape") {

              isNav = true

       } else {

              isIE = true

       }

}

 

// ***Begin CSS custom API Functions***

// Set zIndex property

function setZIndex(obj, zOrder) {

       obj.zIndex = zOrder

}

// Position an object at a specific pixel coordinate

function shiftTo(obj, x, y) {

       if (isNav) {

              obj.moveTo(x,y)

       } else {

              obj.pixelLeft = x

              obj.pixelTop = y

       }

}

// ***End API Functions***

 

// Global holds reference to selected element

var selectedObj

// Globals hold location of click relative to element

var offsetX, offsetY

 

// Find out which element has been clicked on

function setSelectedElem(evt) {

       if (isNav) {

              // declare local var for use in upcoming loop

              var testObj

              // make copies of event coords for use in upcoming loop

              var clickX = evt.pageX

              var clickY = evt.pageY

              // loop through all layers (starting with frontmost layer)

              // to find if the event coordinates are in the layer

              for (var i = document.layers.length - 1; i >= 0; i--) {

                     testObj = document.layers[i]

                     if ((clickX > testObj.left) &&

                            (clickX < testObj.left + testObj.clip.width) &&

                            (clickY > testObj.top) &&

                            (clickY < testObj.top + testObj.clip.height)) {

                                   // if so, then set the global to the layer, bring it

                                   // forward, and get outa here

                                   selectedObj = testObj

                                   setZIndex(selectedObj, 100)

                                   return

                     }

              }

       } else {

              // use IE event model to get the targeted element

              var imgObj = window.event.srcElement

              // make sure it's one of our planes

              if (imgObj.parentElement.id.indexOf("plane") != -1) {

                     // then set the global to the style property of the element,

                     // bring it forward, and say adios

                     selectedObj = imgObj.parentElement.style

                     setZIndex(selectedObj,100)

                     return

              }

       }

       // the user probably clicked on the background

       selectedObj = null

       return

}

// Drag an element

function dragIt(evt) {

       // operate only if a plane is selected

       if (selectedObj) {

              if (isNav) {

                     shiftTo(selectedObj, (evt.pageX - offsetX), (evt.pageY - offsetY))

              } else {

                     shiftTo(selectedObj, (window.event.clientX - offsetX), (window.event.clientY - offsetY))

                     // prevent further system response to dragging in IE

                     return false

              }

       }

}

// Set globals to connect with selected element

function engage(evt) {

       setSelectedElem(evt)

       if (selectedObj) {

              // set globals that remember where the click is in relation to the

              // top left corner of the element so we can keep the element-to-cursor

              // relationship constant throughout the drag

              if (isNav) {

                     offsetX = evt.pageX - selectedObj.left

                     offsetY = evt.pageY - selectedObj.top

              } else {

                     offsetX = window.event.offsetX

                     offsetY = window.event.offsetY

              }

       }

       // block mouseDown event from forcing Mac to display

       // contextual menu.

       return false

}

// Restore elements and globals to initial values

function release(evt) {

       if (selectedObj) {

              setZIndex(selectedObj, 0)

              selectedObj = null

       }

}

// Turn on event capture for Navigator

function setNavEventCapture() {

       if (isNav) {

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

       }

}

// Assign event handlers used by both Navigator and IE (called by onLoad)

function init() {

       if (isNav) {

              setNavEventCapture()

       }

       // assign functions to each of the events (works for both Navigator and IE)

       document.onmousedown = engage

       document.onmousemove = dragIt

       document.onmouseup = release

}

</SCRIPT>

 

 

<DIV ID=plane1><IMG NAME="planePic1" SRC="clock1.jpg" BORDER=0></DIV>

<DIV ID=plane2><IMG NAME="planePic1" SRC="clock2.jpg" BORDER=0></DIV>

 

第二步:<body>区域中内容改为:

<body bgcolor="#fef4d9" onLoad="init()">

0 Comments

Sat

28

Feb

2009

173、图片循环显现

173、图片循环显现

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var interval = 2.5; // delay between rotating images (in seconds)

var random_display = 1; // 0 = no, 1 = yes

interval *= 1000;

 

var image_index = 0;

image_list = new Array();

image_list[image_index++] = new imageItem("01.jpg");

image_list[image_index++] = new imageItem("02.jpg");

image_list[image_index++] = new imageItem("03.jpg");

image_list[image_index++] = new imageItem("04.jpg");

var number_of_image = image_list.length;

function imageItem(image_location) {

this.image_item = new Image();

this.image_item.src = image_location;

}

function get_ImageItemLocation(imageObj) {

return(imageObj.image_item.src)

}

function generate(x, y) {

var range = y - x + 1;

return Math.floor(Math.random() * range) + x;

}

function getNextImage() {

if (random_display) {

image_index = generate(0, number_of_image-1);

}

else {

image_index = (image_index+1) % number_of_image;

}

var new_image = get_ImageItemLocation(image_list[image_index]);

return(new_image);

}

function rotateImage(place) {

var new_image = getNextImage();

document[place].src = new_image;

var recur_call = "rotateImage('"+place+"')";

setTimeout(recur_call, interval);

}

//  End -->

</script>

 

 

 

 

 

第二步:<body>中加入如下代码:

<img name="rImage" src="01.jpg" width=120 height=90>

 

 

 

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

<body bgcolor="#fef4d9" OnLoad="rotateImage('rImage')">

0 Comments

Sat

28

Feb

2009

172、鼠标驱动图片变化

172、鼠标驱动图片变化

脚本说明:

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

<SCRIPT language="JavaScript">

<!-- Begin

function movepic(img_name,img_src) {

document[img_name].src=img_src;

}

// End -->

</SCRIPT>

<A HREF="http://7stk.com"

onmouseover="movepic('button','crab.gif')"

onmouseout="movepic('button','profits.gif')">

<IMG NAME="button" SRC="profits.gif" ALT="Image"></A>

 

0 Comments

Sat

28

Feb

2009

171、随机显示banner

171、随机显示banner

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript">

 

 

<!-- Begin

var how_many_ads = 3;

var now = new Date()

var sec = now.getSeconds()

var ad = sec % how_many_ads;

ad +=1;

if (ad==1) {

txt="The World's Largest Online Bookstore, Amazon.com";

url="http://www.7stk.com";

alt="amazon.com";

banner="http://imageserv.imgis.com/images/Ad12669St1Sz1Sq1_Ban1.gif";

width="468";

height="60";

}

if (ad==2) {

txt="Palm III by 3Com, in stock!";

url="http://7stk.com/";

alt="cybershop.com";

banner="http://imageserv.imgis.com/images/Ad13189St1Sz1Sq5_Ban10.gif";

width="468";

height="60";

}

if (ad==3) {

txt="Find it at GoTo.com";

url="http://www.7syg.com";

alt="goto.com";

banner="http://imageserv.imgis.com/images/Ad13700St1Sz1Sq1_Ban1.gif";

width="468";

height="60";

}

document.write('<center>');

document.write('<a href=\"' + url + '\" target=\"_top\">');

document.write('<img src=\"' + banner + '\" width=')

document.write(width + ' height=' + height + ' ');

document.write('alt=\"' + alt + '\" border=0><br>');

document.write('<small>' + txt + '</small></a>');

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

// End -->

</SCRIPT>

0 Comments

Sat

28

Feb

2009

170、图形显示特效

170、图形显示特效

脚本说明:

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

<SCRIPT>

<!--

transeffect = 0;

theeffects = new Array(24);

theeffects[0] = "盒状收缩";

theeffects[1] = "盒状向外";

theeffects[2] = "圆形收缩";

theeffects[3] = "圆形向内";

theeffects[4] = "从下向上";

theeffects[5] = "从上向下";

theeffects[6] = "从左向右";

theeffects[7] = "从右向左";

theeffects[8] = "百页窗形向右";

theeffects[9] = "百页窗形向下";

theeffects[10] = "棋盘形交叉向右";

theeffects[11] = "棋盘形交叉向下";

theeffects[12] = "随意溶解形";

theeffects[13] = "左右向内";

theeffects[14] = "左右向外";

theeffects[15] = "上下向内";

theeffects[16] = "上下向外";

theeffects[17] = "条纹状向左下";

theeffects[18] = "条纹状向左上";

theeffects[19] = "条纹状向右下";

theeffects[20] = "条纹状向右上";

theeffects[21] = "溶解水平状";

theeffects[22] = "溶解上下状";

theeffects[23] = "随着溶解";

current_image = "image1";

function Clicked() {

       var the_image, the_other;

       text2.style.visiblity="hidden";

       if (image1.style.visibility=="inherit") {

              the_image = image2;

              the_other = image1;

              }

       else {

              the_image = image1;

              the_other = image2;

              }

       the_other.style.visibility="hidden";

       the_image.filters.item(0).Apply();

       the_image.filters.item(0).Transition = transeffect;

       the_image.filters.item(0).Play(2.0);

       the_image.style.visibility="inherit";

       text2.innerText=theeffects[transeffect];

       transeffect++;

       if (transeffect == 24)

              transeffect = 0;

       text2.style.visibility="visible";

}

//-->

 

</SCRIPT>

<DIV id=image>

<DIV id=text1></DIV><IMG id=image1

src="054.gif"

style="FILTER: revealTrans(Duration=3.0,Transition=1); VISIBILITY: hidden"> <IMG id=image2 src="054.gif"

style="FILTER: revealTrans(Duration=3.0,Transition=1); VISIBILITY: hidden"> </DIV>

<DIV id=text2></DIV>

 

 

 

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

<body bgcolor="#fef4d9" onclick=Clicked()>

 

0 Comments

Fri

27

Feb

2009

169、图片向上翻滚

169、图片向上翻滚

脚本说明:

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

<SCRIPT language=JavaScript1.2>

var scrollerwidth=200

var scrollerheight=133

var scrollerbgcolor='white'

//3000 miliseconds=3 seconds

var pausebetweenimages=3000

var slideimages=new Array()

slideimages[0]='<img src="047.gif">'

slideimages[1]='<img src="050.gif">'

slideimages[2]='<img src="048.gif">'

slideimages[3]='<img src="051.gif">'

slideimages[4]='<img src="049.gif">'

slideimages[5]='<img src="052.gif">'

slideimages[6]='<img src="074.gif">'

slideimages[7]='<img src="053.gif">'

slideimages[8]='<img src="054.gif">'

slideimages[9]='<img src="055.gif">'

slideimages[10]='<img src="056.gif">'

slideimages[11]='<img src="073.gif">'

 

//extend this list

 

///////Do not edit pass this line///////////////////////

    

 

if (slideimages.length>1)

i=2

else

i=0

 

function move1(whichlayer){

tlayer=eval(whichlayer)

if (tlayer.top>0&&tlayer.top<=5){

tlayer.top=0

setTimeout("move1(tlayer)",pausebetweenimages)

setTimeout("move2(document.main.document.second)",pausebetweenimages)

return

}

if (tlayer.top>=tlayer.document.height*-1){

tlayer.top-=5

setTimeout("move1(tlayer)",100)

}

else{

tlayer.top=scrollerheight

tlayer.document.write(slideimages[i])

tlayer.document.close()

if (i==slideimages.length-1)

i=0

else

i++

}

}

 

function move2(whichlayer){

tlayer2=eval(whichlayer)

if (tlayer2.top>0&&tlayer2.top<=5){

tlayer2.top=0

setTimeout("move2(tlayer2)",pausebetweenimages)

setTimeout("move1(document.main.document.first)",pausebetweenimages)

return

}

if (tlayer2.top>=tlayer2.document.height*-1){

tlayer2.top-=5

setTimeout("move2(tlayer2)",100)

}

else{

tlayer2.top=scrollerheight

tlayer2.document.write(slideimages[i])

tlayer2.document.close()

if (i==slideimages.length-1)

i=0

else

i++

}

}

 

function move3(whichdiv){

tdiv=eval(whichdiv)

if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5){

tdiv.style.pixelTop=0

setTimeout("move3(tdiv)",pausebetweenimages)

setTimeout("move4(second2)",pausebetweenimages)

return

}

if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){

tdiv.style.pixelTop-=5

setTimeout("move3(tdiv)",100)

}

else{

tdiv.style.pixelTop=scrollerheight

tdiv.innerHTML=slideimages[i]

if (i==slideimages.length-1)

i=0

else

i++

}

}

 

function move4(whichdiv){

tdiv2=eval(whichdiv)

if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5){

tdiv2.style.pixelTop=0

setTimeout("move4(tdiv2)",pausebetweenimages)

setTimeout("move3(first2)",pausebetweenimages)

return

}

if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){

tdiv2.style.pixelTop-=5

setTimeout("move4(second2)",100)

}

else{

tdiv2.style.pixelTop=scrollerheight

tdiv2.innerHTML=slideimages[i]

if (i==slideimages.length-1)

i=0

else

i++

}

}

 

function startscroll(){

if (document.all){

move3(first2)

second2.style.top=scrollerheight

}

else if (document.layers){

document.main.visibility='show'

move1(document.main.document.first)

document.main.document.second.top=scrollerheight+5

document.main.document.second.visibility='show'

}

}

 

window.onload=startscroll

 

</SCRIPT>

<SCRIPT language=JavaScript1.2>

if (document.all){

document.writeln('<center><span id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hiden;background-color:'+scrollerbgcolor+'">')

document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0;top:0">')

document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0;top:1;">')

document.write(slideimages[0])

document.writeln('</div>')

document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0;top:0">')

document.write(slideimages[1])

document.writeln('</div>')

document.writeln('</div>')

document.writeln('</span>')

}

</SCRIPT>

 

0 Comments

Fri

27

Feb

2009

168、图片向左翻滚

168、图片向左翻滚

脚本说明:

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

<SCRIPT language=JavaScript1.2>

<!--

var sliderwidth=500

var sliderheight=133

var slidespeed=4

 

var leftrightslide=new Array()

var finalslide=''

leftrightslide[0]='<a href="http://www.http://www.7stk.com.com"><img src="047.gif" border=0></a>'

leftrightslide[1]='<a href="http://www.http://www.7stk.com.com"><img src="050.gif" border=0></a>'

leftrightslide[2]='<a href="http://www.http://www.7stk.com.com"><img src="048.gif" border=0></a>'

leftrightslide[3]='<a href="http://www.http://www.7stk.com.com"><img src="051.gif" border=0></a>'

leftrightslide[4]='<a href="http://www.http://www.7stk.com.com"><img src="049.gif" border=0></a>'

leftrightslide[5]='<a href="http://www.http://www.7stk.com.com"><img src="052.gif" border=0></a>'

leftrightslide[6]='<a href="http://www.http://www.7stk.com.com"><img src="074.gif" border=0></a>'

leftrightslide[7]='<a href="http://www.http://www.7stk.com.com"><img src="053.gif" border=0></a>'

leftrightslide[8]='<a href="http://www.http://www.7stk.com.com"><img src="054.gif" border=0></a>'

leftrightslide[9]='<a href="http://www.http://www.7stk.com.com"><img src="055.gif" border=0></a>'

leftrightslide[10]='<a href="http://www.http://www.7stk.com.com"><img src="056.gif" border=0></a>'

leftrightslide[11]='<a href="http://www.http://www.7stk.com.com"><img src="073.gif" border=0></a>'

var copyspeed=slidespeed

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

finalslide=finalslide+leftrightslide[i]+"&nbsp;&nbsp;"

 

 

if (document.all){

document.write('<marquee id="ieslider" scrollAmount=0 style="width:'+sliderwidth+'">'+finalslide+'</marquee>')

ieslider.onmouseover=new Function("ieslider.scrollAmount=0")

ieslider.onmouseout=new Function("if (document.readyState=='complete') ieslider.scrollAmount=slidespeed")

}

 

function regenerate(){

window.location.reload()

}

function regenerate112(){

if (document.layers){

document.ns_slider01.visibility="show"

setTimeout("window.onresize=regenerate",450)

intializeleftrightslide()

}

if (document.all)

ieslider.scrollAmount=slidespeed

}

 

function intializeleftrightslide(){

document.ns_slider01.document.ns_slider02.document.write('<nobr>'+finalslide+'</nobr>')

document. ns_slider01.document.ns_slider02.document.close()

thelength=document.ns_slider01.document.ns_slider02.document.width

scrollslide()

}

 

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=regenerate112

 

//-->

</SCRIPT>

 

0 Comments

Fri

27

Feb

2009

167、图片放大镜效果

167、图片放大镜效果

脚本说明:

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

<STYLE type=text/css>#mglass {

       LEFT: -2000px; POSITION: absolute; TOP: 50px

}

#thumb {

       LEFT: -2000px; POSITION: absolute; TOP: 50px

}

#large {

       LEFT: -2000px; POSITION: absolute; TOP: 50px

}

#framegif {

       LEFT: -2000px; POSITION: absolute; TOP: 50px

}

.baseline {

       COLOR: #000000; FONT-FAMILY: Arial; FONT-SIZE: 9pt; LEFT: 50px; POSITION: absolute; TOP: 260px

}

</STYLE>

<SCRIPT language=JavaScript>

<!-- Beginning of JavaScript -

var isNav, isIE

var offsetX, offsetY

var selectedObj

 

var enlargefactor=5

 

var largewidth = 455

var largeheight = 523

var largeleft = 250

var largetop = 30

 

var thumbwidth = Math.floor(largewidth/enlargefactor)

var thumbheight = Math.floor(largeheight/enlargefactor)

var thumbleft = 50

var thumbtop = 30

 

var mglasswidth = 32

var mglassheight = 32

var mglassleft = 120

var mglasstop = 110

 

var difleft= largeleft-thumbleft

var diftop= largetop-thumbtop

 

var clippoints

 

var cliptop = (thumbheight-mglassheight)*enlargefactor

var clipbottom = cliptop+(mglassheight*enlargefactor)

var clipleft =(thumbwidth-mglasswidth)*enlargefactor

var clipright = clipleft+(mglasswidth*enlargefactor)

 

 

if (parseInt(navigator.appVersion) >= 4) {

       if (navigator.appName == "Netscape") {

              isNav = true

       } else {

              isIE = true

       }

}

 

function setZIndex(obj, zOrder) {

       obj.zIndex = zOrder

}

 

function shiftTo(obj, x, y) {

       if (isNav) {

              obj.moveTo(x,y)

       } else {

              obj.pixelLeft = x

              obj.pixelTop = y

       }    

       cliptop = (y-thumbtop)*enlargefactor

       clipbottom = cliptop+(mglassheight*enlargefactor)

       clipleft = (x-thumbleft)*enlargefactor

       clipright = clipleft+(mglasswidth*enlargefactor)

 

      

       if (document.all) {

              clippoints ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"

              document.all.large.style.posTop=largetop-cliptop

              document.all.large.style.posLeft=largeleft-clipleft

              document.all.large.style.clip=clippoints

       }

       if (document.layers) {

              document.large.top=largetop-cliptop

              document.large.left=largeleft-clipleft

              document.large.clip.left = clipleft

              document.large.clip.right = clipright

              document.large.clip.top = cliptop

              document.large.clip.bottom = clipbottom

       }

}

 

function setSelectedElem(evt) {

       if (isNav) {

              var testObj

              var clickX = evt.pageX

              var clickY = evt.pageY

              for (var i = document.layers.length - 1; i >= 0; i--) {

                     testObj = document.layers[i]

                     if ((clickX > testObj.left) &&

                            (clickX < testObj.left + testObj.clip.width) &&

                            (clickY > testObj.top) &&

                            (clickY < testObj.top + testObj.clip.height)) {

                                   selectedObj = testObj

                                   setZIndex(selectedObj, 100)

                                   return

                     }

              }

       } else {

              var imgObj = window.event.srcElement

              if (imgObj.parentElement.id.indexOf("mglass") != -1) {

                     selectedObj = imgObj.parentElement.style

                     setZIndex(selectedObj,100)

                     return

              }

       }

       selectedObj = null

       return

}

 

function dragIt(evt) {

       if (selectedObj) {

              if (isNav) {

                     shiftTo(selectedObj, (evt.pageX - offsetX), (evt.pageY - offsetY))

              } else {

                     shiftTo(selectedObj, (window.event.clientX - offsetX), (window.event.clientY - offsetY))

                     return false

              }

       }

}

 

function engage(evt) {

       setSelectedElem(evt)

       if (selectedObj) {

              if (isNav) {

                     offsetX = evt.pageX - selectedObj.left

                     offsetY = evt.pageY - selectedObj.top

              } else {

                     offsetX = window.event.offsetX

                     offsetY = window.event.offsetY

              }

       }

       return false

}

 

function release(evt) {

       if (selectedObj) {

              setZIndex(selectedObj, 0)

              selectedObj = null

       }

}

 

function setNavEventCapture() {

       if (isNav) {

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

       }

}

 

function init() {

 

       if (document.layers) {

              document.large.left=largeleft

              document.large.top=largetop

             

              document.framegif.left=largeleft-3

              document.framegif.top=largetop-3

      

              document.thumb.left=thumbleft

              document.thumb.top=thumbtop

      

              document.mglass.left=mglassleft

              document.mglass.top=mglasstop

             

              document.large.clip.left = 0

              document.large.clip.right = 0

              document.large.clip.top = 0

              document.large.clip.bottom = 0

             

              setNavEventCapture()

       }

      

       if (document.all) {

              document.all.large.style.posLeft=largeleft

              document.all.large.style.posTop=largetop

             

              document.all.framegif.style.posLeft=largeleft-3

              document.all.framegif.style.posTop=largetop-3

      

              document.all.thumb.style.posLeft=thumbleft

              document.all.thumb.style.posTop=thumbtop

      

              document.all.mglass.style.posLeft=mglassleft

              document.all.mglass.style.posTop=mglasstop

              document.all.large.style.clip="rect(0 0 0 0)"

       }

      

       document.onmousedown = engage

       document.onmousemove = dragIt

       document.onmouseup = release

}

// - End of JavaScript - -->

</SCRIPT>

<span id=thumb><IMG name=thumbpic src="portrait2311.jpg" width=91>

</span>

<span id=framegif><IMG height=166 name=framepic src="frame2311.gif"

width=166> </span>

<span id=large><IMG name=largepic src="portrait2311.jpg" width=455>

</span>

<span id=mglass><IMG height=50 name=mglasspic src="mglass.gif"

width=50> </span>

 

 

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

<body bgcolor="#fef4d9" onload=init()>

0 Comments

Fri

27

Feb

2009

166、图片左右飞舞

166、图片左右飞舞

脚本说明:

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

<script language="JavaScript">

 var pos1=-95;

 var pos2=-95;

 var pos3=-95;

 var pos4=-95;

 

 var speed1 = Math.floor(Math.random()*10)+2;

 var speed2 = Math.floor(Math.random()*10)+2;

 var speed3 = Math.floor(Math.random()*10)+2;

 var speed4 = Math.floor(Math.random()*10)+2;

 

  function next() {

    pos1 += speed1;

    pos2 += speed2;

    pos3 += speed3;

    pos4 += speed4;

 

    if (pos1 > 795) pos1 = -95;

    if (pos2 > 795) pos2 = -95;

    if (pos3 > 795) pos3 = -95;

    if (pos4 > 795) pos4 = -95;

 

    if (document.layers) {

       document.layers[0].left = pos1;

       document.layers[1].left = pos2;

       document.layers[2].left = pos3;

       document.layers[3].left = pos4;

 

    }

    else {

       mouse1.style.left = pos1;

       mouse2.style.left = pos2;

       mouse3.style.left = pos3;

       mouse4.style.left = pos4;

 

    }

    window.setTimeout("next();",10);

 }

 </script>

 <div id="mouse1"

style="HEIGHT: 100px; LEFT: 0px; POSITION: absolute; TOP: 165px; WIDTH: 100px">

<dd><img alt border="0" src="image1.gif" width="30" height="30"> </dd>

</div><div id="mouse2"

style="HEIGHT: 100px; LEFT: 0px; POSITION: absolute; TOP: 250px; WIDTH: 100px">

<dd><img alt border="0" src="image2.gif" width="72" height="32"></dd>

</div><div id="mouse3"

style="HEIGHT: 100px; LEFT: 0px; POSITION: absolute; TOP: 333px; WIDTH: 100px">

<dd><img alt border="0" src="image3.gif" width="72" height="32"></dd>

</div><div id="mouse4"

style="HEIGHT: 100px; LEFT: 0px; POSITION: absolute; TOP: 415px; WIDTH: 100px">

<dd><img alt border="0" src="image4.gif" width="72" height="32"></dd>

</div>

 

 

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

<body bgcolor="#fef4d9" onload="next();">

 

0 Comments

Fri

27

Feb

2009

165、图片随意飘动

165、图片随意飘动

脚本说明:

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

<div id="img" style="position:absolute;">

<img src="gq.gif" onClick="pause_resume();">

</div>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

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('changePos()', delay);

}

function pause_resume() {

if(pause) {

clearInterval(interval);

pause = false;

}

else {

interval = setInterval('changePos()',delay);

pause = true;

   }

}

start();

//  End -->

</script>

0 Comments

Fri

27

Feb

2009

164、图片链接文本说明

164、图片链接文本说明

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript">

 

<!-- Begin

function showMsg(text) {

document.picform.message.value = text;

}

//  End -->

</script>

<ul>

<li>

<a href="HTTP://WWW.7syg.COM"

onmouseover="showMsg('图片1的文字说明....');"

onmouseout="showMsg('');">

<img name="button1" src="fade02.jpg"></a>

</li>

<li>

<a href="HTTP://WWW.7stk.COM"

onmouseover="showMsg('图片2的文字说明....');"

onmouseout="showMsg('');">

<img name="button2" src="fade02.jpg"></a>

</li>

<li>

<a href="HTTP://WWW.7stk.COM"

onmouseover="showMsg('图片3的文字说明....');"

onmouseout="showMsg('');">

<img name="button3" src="fade01.jpg"></a>

</li>

<form name="picform">

<textarea name=message rows=2 cols=40 wrap=virtual>choose an image above for a description!</textarea><br>

<input type=hidden name=go value="">

</form>

 

0 Comments

Fri

27

Feb

2009

163、图片循环显示

163、图片循环显示

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var rotate_delay = 5000; // delay in milliseconds (5000 = 5 secs)

current = 0;

function next() {

if (document.slideform.slide[current+1]) {

document.images.show.src = document.slideform.slide[current+1].value;

document.slideform.slide.selectedIndex = ++current;

   }

else first();

}

function previous() {

if (current-1 >= 0) {

document.images.show.src = document.slideform.slide[current-1].value;

document.slideform.slide.selectedIndex = --current;

   }

else last();

}

function first() {

current = 0;

document.images.show.src = document.slideform.slide[0].value;

document.slideform.slide.selectedIndex = 0;

}

function last() {

current = document.slideform.slide.length-1;

document.images.show.src = document.slideform.slide[current].value;

document.slideform.slide.selectedIndex = current;

}

function ap(text) {

document.slideform.slidebutton.value = (text == "Stop") ? "Start" : "Stop";

rotate();

}

function change() {

current = document.slideform.slide.selectedIndex;

document.images.show.src = document.slideform.slide[current].value;

}

function rotate() {

if (document.slideform.slidebutton.value == "Stop") {

current = (current == document.slideform.slide.length-1) ? 0 : current+1;

document.images.show.src = document.slideform.slide[current].value;

document.slideform.slide.selectedIndex = current;

window.setTimeout("rotate()", rotate_delay);

   }

}

//  End -->

</script>

<center>

<form name=slideform>

<table cellspacing=1 cellpadding=4 bgcolor="#000000">

<tr>

<td align=center bgcolor="white">

<b>图片循环</b>

</td>

</tr>

<tr>

<td align=center bgcolor="white" width=200 height=150>

<img src="cart.gif" name="show">

</td>

</tr>

<tr>

<td align=center bgcolor="#C0C0C0">

<select name="slide" onChange="change();">

<option value="cart.gif" selected>车子

<option value="aat.gif">防空坦克

<option value="boat.gif">汽艇

<option value="enterprise.gif">Enterprise

<option value="ewing.gif">E-Wing

<option value="f18.gif">F-18

<option value="klingon.gif">Klingon

<option value="landingcraft.gif">太空飞船

<option value="hoverracer.gif">Hover Racer

<option value="sith.gif">Sith

</select>

</td>

</tr>

<tr>

<td align=center bgcolor="#C0C0C0">

<input type=button onClick="first();" value="|<<" title="Beginning">

<input type=button onClick="previous();" value="<<" title="Previous">

<input type=button name="slidebutton" onClick="ap(this.value);" value="Start" title="AutoPlay">

<input type=button onClick="next();" value=">>" title="Next">

<input type=button onClick="last();" value=">>|" title="End">

</td>

</tr>

</table>

</form>

</center>

 

 

0 Comments

Fri

27

Feb

2009

162、图片上下飘动

162、图片上下飘动

脚本说明:

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

 <SCRIPT language=javascript>

         <!-- Begin

var ns4up = (document.layers) ? 1 : 0; 

var ie4up = (document.all) ? 1 : 0;

var no = 1;                             // pic number

var speed = 20;                         // smaller number moves the pic faster

var snowflake = "logo1205.jpg";              //pic image

var filen = "http://www.7stk.com/"           // link web file

var dx, xp, yp;                         // coordinate and position variables

var am, stx, sty;                       // amplitude and step variables

var i, doc_width = 400, doc_height = 600;

if (ns4up) {

doc_width = self.innerWidth;

doc_height = self.innerHeight;

} else if (ie4up) {

doc_width = document.body.clientWidth;

doc_height = document.body.clientHeight;

}

dx = new Array();

xp = new Array();

yp = new Array();

am = new Array();

stx = new Array();

sty = new Array();

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

{ 

dx[i] = 0;                             // set coordinate variables

xp[i] = Math.random()*(doc_width-50);  // set position variables

yp[i] = Math.random()*doc_height;

am[i] = Math.random()*20;              // set amplitude variables

stx[i] = 0.02 + Math.random()/10;      // set step variables

sty[i] = 0.7 + Math.random();          // set step variables

if (ns4up) {                           // set layers

if (i == 0) {

document.write("<html><title></title><body>");

document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");

document.write("top=\"15\" visibility=\"show\"><A href=\"" + filen + "\" target=\"_blank\"><img src=\"");

document.write(snowflake + "\" border=\"0\"></layer>");

document.write("</body></html>");

} else {

document.write("<html><title></title><body>");

document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");

document.write("top=\"15\" visibility=\"show\"><A href=\"" + filen + "\" target=\"_blank\"><img src=\"");

document.write(snowflake + "\" border=\"0\"></layer>");

document.write("</body></html>");

}

} else if (ie4up) {

if (i == 0) {

document.write("<html><title></title><body>");

document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");

document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");

document.write("visible; TOP: 15px; LEFT: 15px;\"><a href=\""+filen+"\" target=\"_blank\"><img src=\"");

document.write(snowflake + "\" border=\"0\"></div>");

document.write("</body></html>");

} else {

document.write("<html><title></title><body>");

document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");

document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");

document.write("visible; TOP: 15px; LEFT: 15px;\"><a href=\""+filen+"\" target=\"_blank\"><img src=\"");

document.write(snowflake + "\" border=\"0\"></div>");

document.write("</body></html>");

}

}

}

function snowNS() {  // Netscape main animation function

for (i = 0; i < no; ++ i) {  // iterate for every dot

yp[i] += sty[i];

if (yp[i] > doc_height-50) {

xp[i] = Math.random()*(doc_width-am[i]-30);

yp[i] = 0;

stx[i] = 0.02 + Math.random()/10;

sty[i] = 0.7 + Math.random();

doc_width = self.innerWidth;

doc_height = self.innerHeight;

}

dx[i] += stx[i];

document.layers["dot"+i].top = yp[i];

document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]);

}

setTimeout("snowNS()", speed);

}

function snowIE() {  // IE main animation function

for (i = 0; i < no; ++ i) {  // iterate for every dot

yp[i] += sty[i];

if (yp[i] > doc_height-50) {

xp[i] = Math.random()*(doc_width-am[i]-30);

yp[i] = 0;

stx[i] = 0.02 + Math.random()/10;

sty[i] = 0.7 + Math.random();

doc_width = document.body.clientWidth;

doc_height = document.body.clientHeight;

}

dx[i] += stx[i];

document.all["dot"+i].style.pixelTop = yp[i];

document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);

}

setTimeout("snowIE()", speed);

}

if (ns4up) {

snowNS();

} else if (ie4up) {

snowIE();

}

// End -->

</SCRIPT>

 

1 Comments

Fri

27

Feb

2009

161、Radio选图片

161Radio选图片

脚本说明:

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

<IMG height=109 name=katochan src="banner0.gif" width=96>

<SCRIPT language=JavaScript>

<!--

function fuyase(n){document.katochan.src = (n+"manbon.gif")}

//-->

</SCRIPT>

 

<FORM name=honsuu>

<INPUT CHECKED name=kami onclick=fuyase(0) type=radio>图片一

<INPUT name=kami onclick=fuyase(1) type=radio>图片二

<INPUT name=kami onclick=fuyase(10) type=radio>图片三

<INPUT name=kami onclick=fuyase(100) type=radio>图片四

</FORM>

0 Comments

Fri

27

Feb

2009

160、鼠标驱动图片抖动

160、鼠标驱动图片抖动

脚本说明:

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

<script language="JavaScript1.2">

var rector=3

var stopit=0

var a=1

 

function init(which){

stopit=0

shake=which

shake.style.left=0

shake.style.top=0

}

 

function rattleimage(){

if ((!document.all&&!document.getElementById)||stopit==1)

return

if (a==1){

shake.style.top=parseInt(shake.style.top)+rector

}

else if (a==2){

shake.style.left=parseInt(shake.style.left)+rector

}

else if (a==3){

shake.style.top=parseInt(shake.style.top)-rector

}

else{

shake.style.left=parseInt(shake.style.left)-rector

}

if (a<4)

a++

else

a=1

setTimeout("rattleimage()",50)

}

 

function stoprattle(which){

stopit=1

which.style.left=0

which.style.top=0

}

 

</script>

<style>

.shakeimage{

position:relative

}

</style>

<img src="1207.gif" class="shakeimage" onMouseOver="init(this);rattleimage()" onMouseOut="stoprattle(this)">

 

0 Comments

Fri

27

Feb

2009

159、图片上下飘动

159、图片上下飘动

脚本说明:

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

<div id="point1" STYLE="position:absolute;visibility:visible;">

<table border="0" cellspacing="0" cellpadding="0">

<tr><td><a href="http://www.7stk.com"><img src="exchangelogo.gif" alt="" border="0"></a>

</td></tr><tr><td><center><a href="http://www.7stk.com">

<font face="Arial" size="2" color="#0000FF">网页特效代码</font>

</a></center></td></tr></table>

</div>

<script LANGUAGE="JavaScript1.2">

 

var XX=20; // X position of the scrolling objects

var xstep=1;

var delay_time=60;

 

//Begin of the unchangable area, please do not modify this area

var YY=0; 

var ch=0;

var oh=0;

var yon=0;

 

var ns4=document.layers?1:0

var ie=document.all?1:0

var ns6=document.getElementById&&!document.all?1:0

 

if(ie){

YY=document.body.clientHeight;

point1.style.top=YY;

}

else if (ns4){

YY=window.innerHeight;

document.point1.pageY=YY;

document.point1.visibility="hidden";

}

else if (ns6){

YY=window.innerHeight

document.getElementById('point1').style.top=YY

}

 

 

function reloc1()

{

 

if(yon==0){YY=YY-xstep;}

else{YY=YY+xstep;}

if (ie){

ch=document.body.clientHeight;

oh=point1.offsetHeight;

}

else if (ns4){

ch=window.innerHeight;

oh=document.point1.clip.height;

}

else if (ns6){

ch=window.innerHeight

oh=document.getElementById("point1").offsetHeight

}

             

if(YY<0){yon=1;YY=0;}

if(YY>=(ch-oh)){yon=0;YY=(ch-oh);}

if(ie){

point1.style.left=XX;

point1.style.top=YY+document.body.scrollTop;

}

else if (ns4){

document.point1.pageX=XX;

document.point1.pageY=YY+window.pageYOffset;

}

else if (ns6){

document.getElementById("point1").style.left=XX

document.getElementById("point1").style.top=YY+window.pageYOffset

}

 

}

 

function onad()

{

if(ns4)

document.point1.visibility="visible";

loopfunc();

}

function loopfunc()

{

reloc1();

setTimeout('loopfunc()',delay_time);

}

 

if (ie||ns4||ns6)

window.onload=onad

 

</script>

 

0 Comments

Fri

27

Feb

2009

158、多图片飞舞链接

158、多图片飞舞链接

脚本说明:

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

<script language="JavaScript">

 

var brOK=false;

var mie=false;

var aver=parseInt(navigator.appVersion.substring(0,1));

var aname=navigator.appName;

 

function checkbrOK()

{if(aname.indexOf("Internet Explorer")!=-1)

   {if(aver>=4) brOK=navigator.javaEnabled();

    mie=true;

   }

 if(aname.indexOf("Netscape")!=-1) 

   {if(aver>=4) brOK=navigator.javaEnabled();}

}

 

var vmin=2;

var vmax=5;

var vr=2;

var timer1;

 

function Chip(chipname,width,height)

{this.named=chipname;

 this.vx=vmin+vmax*Math.random();

 this.vy=vmin+vmax*Math.random();

 this.w=width;

 this.h=height;

 this.xx=0;

 this.yy=0;

 this.timer1=null;

}

 

function movechip(chipname)

{

 if(brOK)

  {eval("chip="+chipname);

   if(!mie)

    {pageX=window.pageXOffset;

     pageW=window.innerWidth-20;

     pageY=window.pageYOffset;

     pageH=window.innerHeight-20;

    }

   else

    {pageX=window.document.body.scrollLeft;

     pageW=window.document.body.offsetWidth-20;

     pageY=window.document.body.scrollTop;

     pageH=window.document.body.offsetHeight-20;

    }

 

   chip.xx=chip.xx+chip.vx;

   chip.yy=chip.yy+chip.vy;

  

   chip.vx+=vr*(Math.random()-0.5);

   chip.vy+=vr*(Math.random()-0.5);

   if(chip.vx>(vmax+vmin))  chip.vx=(vmax+vmin)*2-chip.vx;

   if(chip.vx<(-vmax-vmin)) chip.vx=(-vmax-vmin)*2-chip.vx;

   if(chip.vy>(vmax+vmin))  chip.vy=(vmax+vmin)*2-chip.vy;

   if(chip.vy<(-vmax-vmin)) chip.vy=(-vmax-vmin)*2-chip.vy;

 

 

   if(chip.xx<=pageX)

     {chip.xx=pageX;

      chip.vx=vmin+vmax*Math.random();

     }

   if(chip.xx>=pageX+pageW-chip.w)

     {chip.xx=pageX+pageW-chip.w;

      chip.vx=-vmin-vmax*Math.random();

     }

   if(chip.yy<=pageY)

     {chip.yy=pageY;

      chip.vy=vmin+vmax*Math.random();

     }

   if(chip.yy>=pageY+pageH-chip.h)

     {chip.yy=pageY+pageH-chip.h;

      chip.vy=-vmin-vmax*Math.random();

     }

 

   if(document.layers)

      {eval('document.'+chip.named+'.top ='+chip.yy);

       eval('document.'+chip.named+'.left='+chip.xx);

      }

   else if (document.all)

      {eval('document.all.'+chip.named+'.style.pixelLeft='+chip.xx);

       eval('document.all.'+chip.named+'.style.pixelTop ='+chip.yy);

      }

   else if (document.getElementById)

      {document.getElementById(chip.named).style.left=chip.xx;

       document.getElementById(chip.named).style.top =chip.yy;

      }

   chip.timer1=setTimeout("movechip('"+chip.named+"')",100);

  }

}

 

 

function stopme(chipname)

{if(brOK)

  {//alert(chipname)

   eval("chip="+chipname);

   if(chip.timer1!=null)

    {clearTimeout(chip.timer1)}

  }

}

 

</script>

<script>

 

var chip1;

var chip2;

var chip3;

//add or delete more variables, depending on how many images you're using

 

function pagestart()

{checkbrOK();

 chip1=new Chip("chip1",60,80);

 chip2=new Chip("chip2",60,80);

 chip3=new Chip("chip3",60,80);

 //add or delete more of the above, depending on how many images you're using

 if(brOK)

   { movechip("chip1");

     movechip("chip2");

     movechip("chip3");

     //add or delete more of the above, depending on how many images you're using

   }

}

</script>

<DIV ID="chip1" STYLE="position:absolute; width:47; height:68;">

<A HREF="http://www.7syg.com"><IMG SRC="dynamic.gif" BORDER=0></a>

</DIV>

<DIV ID="chip2" STYLE="position:absolute; width:47; height:68;">

<A HREF="http://www.sina.com.cn"><IMG SRC="butterfly.gif" BORDER=0></a>

</DIV>

<DIV ID="chip3" STYLE="position:absolute; width:47; height:68;">

<A HREF="http://www.7stk.com"><IMG SRC="cute.gif" BORDER=0></a>

</DIV>

 

 

 

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

<body onLoad="pagestart();" onUnload="if(brOK) {stopme('chip1'); stopme('chip2'); stopme('chip3');}" >

 

0 Comments

Fri

27

Feb

2009

155、按分辨率显示图片

155、按分辨率显示图片

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript1.2">

 

<!-- Begin

if (screen.height >= 768 && screen.width >= 1024) {

document.write("<img src='line073.gif' width=700 border=0>");

}

else {

if (screen.height == 600 && screen.width == 800) {

document.write("<img src='line073.gif' width=400 border=0>");

}

else {

document.write("<img src='line073.gif' width=300 border=0>");

   }

}

//  End -->

</script>

 

 

0 Comments

Fri

27

Feb

2009

157、图片显示效果

157、图片显示效果

脚本说明:

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

<DIV id=person>

<P align=center><IMG height=240 src="person810.jpg" width=315>

</P></DIV>

<DIV id=colortables

style="HEIGHT: 240px; LEFT: 231px; POSITION: absolute; TOP: 115px; WIDTH: 315px">

<TABLE border=0 cellPadding=0 cellSpacing=0 height=240 width=315>

  <TBODY>

  <TR>

    <TD bgColor=#ff0000 onmouseover="show('FF0000')"></TD>

    <TD bgColor=#ff3333 onmouseover="show('FF3333')"></TD>

    <TD bgColor=#ff5555 onmouseover="show('FF5555')"></TD>

    <TD bgColor=#ff7777 onmouseover="show('FF7777')"></TD>

    <TD bgColor=#ffaaaa onmouseover="show('FFaaaa')"></TD>

    <TD bgColor=#ffcccc onmouseover="show('FFcccc')"></TD></TR>

  <TR>

    <TD bgColor=#ff00ff onmouseover="show('FF00ff')"></TD>

    <TD bgColor=#ff33ff onmouseover="show('FF33ff')"></TD>

    <TD bgColor=#ff55ff onmouseover="show('FF55ff')"></TD>

    <TD bgColor=#ff88ff onmouseover="show('FF88ff')"></TD>

    <TD bgColor=#ffaaff onmouseover="show('FFaaff')"></TD>

    <TD bgColor=#ffccff onmouseover="show('FFccff')"></TD></TR>

  <TR>

    <TD bgColor=#0011ff onmouseover="show('0011FF')"></TD>

    <TD bgColor=#1133ff onmouseover="show('1133FF')"></TD>

    <TD bgColor=#2255ff onmouseover="show('2255FF')"></TD>

    <TD bgColor=#3377ff onmouseover="show('3377FF')"></TD>

    <TD bgColor=#44aaff onmouseover="show('44aaFF')"></TD>

    <TD bgColor=#55ddff onmouseover="show('55ddFF')"></TD></TR>

  <TR>

    <TD bgColor=#22ff22 onmouseover="show('22ff22')"></TD>

    <TD bgColor=#55ff55 onmouseover="show('55ff55')"></TD>

    <TD bgColor=#77ff77 onmouseover="show('77ff77')"></TD>

    <TD bgColor=#aaffaa onmouseover="show('aaffaa')"></TD>

    <TD bgColor=#ccffcc onmouseover="show('ccffcc')"></TD>

    <TD bgColor=#ddffdd

onmouseover="show('ddffdd')"></TD></TR></TBODY></TABLE></DIV>

<DIV id=redirection

style="LEFT: 420px; POSITION: absolute; TEXT-ALIGN: center; TOP: 10px; WIDTH: 180px; text-valign: center"></DIV>

<SCRIPT language=javaScript>

<!-- Beginning of JavaScript -        

        

        

function positionimage() {        

       if (document.all) {        

              document.all.person.style.posTop=10        

              document.all.person.style.posLeft=80        

              document.all.person.style.visibility="VISIBLE"        

       }        

}        

function show(thiscolor) {        

       if(document.all) {document.all.colortables.style.filter="chroma(color="+thiscolor+")"}        

}        

        

// - End of JavaScript - --> 

</SCRIPT>

 

        

0 Comments

Fri

27

Feb

2009

156、图片渐变效果

156、图片渐变效果

脚本说明:

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

<SCRIPT>

// the name of your first picture-file

var picture1="042.gif"

 

// the name of your second picture-file

var picture2="043.gif"

 

// the name of your second picture-file

var picture3="044.gif"

 

// the width and height of your pictures (pixels)

var picturewidth=220

var pictureheight=244

 

</SCRIPT>

 

      <SCRIPT>

         if (document.all) {

document.write('<OBJECT ID="DAControl_Wipe" ')

document.write('STYLE="width:'+picturewidth+';height:'+pictureheight+'"')

document.write('CLASSID="CLSID:B6FFC24C-7E13-11D0-9B47-00C04FC2F51D">')

document.write('</OBJECT>')

m = DAControl_Wipe.MeterLibrary;

 

whatTransformation = new ActiveXObject("DXImageTransform.Microsoft.Wipe");

 

whatPictures = new Array();     

whatPictures[0] = m.ImportImage(picture1);

whatPictures[1] = m.ImportImage(picture2);

 

forward = m.Interpolate(0, 1, 3);

back = m.Interpolate(1, 0, 2);

whatMovement = m.Sequence(forward, back).RepeatForever();

 

whatTransformation.GradientSize = 1.0;

whatTransformation.WipeStyle = 0;

 

theResult = m.ApplyDXTransform( whatTransformation, whatPictures, whatMovement );

 

DAControl_Wipe.Image = theResult.OutputBvr;

DAControl_Wipe.Start();

 

}

         </SCRIPT>

0 Comments

Fri

27

Feb

2009

154、飞碟攻击鼠标

154、飞碟攻击鼠标

脚本说明:

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

<script language="JavaScript">

var starttime = 10000; // time before script starts, in milliseconds

var ufocontrol = true; // can UFOs be turned off?  true or false

var nImpactos = 3;

var nOvnis = 3;

var Xpos = 0;

var Ypos = 0;

var STOPACCEL = 10;

var TAMOVNI = 20;

var REBOTE = 0.65;

var isNetscape = navigator.appName == "Netscape";

var impactoActual = 0;

var ovnis = new Array();

var disparos = new Array();

var impactos = new Array();

var impactos2 = new Array();

var activos = true;

var fondoMovil = false;

var backgroundOffset = 0;

init();

function changeUFOs(element) {

activos = element.checked;

}

function init() {

var text;

var i = 0;

text  = "<div id=imp20 style='POSITION: absolute;'>";

text += "<img src='impact2.gif' WIDTH=11 height=14 align=bottom></div>";

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

text += "<div id=imp1" + i + " style='POSITION: absolute;'>";

text += "<img src='impact1.gif' WIDTH=23 height=31 align=bottom></div>";

}

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

text += "<div id=dis" + i + " style='POSITION: absolute;'>";

text += "<img src='bullet.gif' WIDTH=5 height=5 align=bottom></div>";

}

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

text += "<div id=ovn" + i + " style='POSITION: absolute;'>";

text += "<img src='alien.gif' WIDTH=29 height=24 align=bottom></div>";

}

text += "\n";

document.write(text);

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

impactos2[i] = new impacto2(i);

impactos2[i].obj.left = -25;

impactos2[i].obj.top = -25;

}

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

impactos[i] = new impacto1(i);

impactos[i].obj.left = -50;

impactos[i].obj.top = -50;

}

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

disparos[i] = new disparo(i);

disparos[i].obj.left = -5;

disparos[i].obj.top = -5;

}

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

ovnis[i] = new ovni(i);

ovnis[i].obj.left = -29;

ovnis[i].obj.top = -24;

}

if (ufocontrol) {

document.write('<form>');

document.write('<input type=checkbox onClick="changeUFOs(this)" CHECKED>');

document.write('打开/关闭飞碟');

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

}

if (isNetscape) {

startanimate();

}

else {

setTimeout("startanimate()", starttime);

   }

}

function impacto1(i) {

this.X = -20;

this.Y = -20;

if (isNetscape) {

this.obj = eval("document.imp1" + i);

}

else {

this.obj = eval("imp1" + i + ".style");

   }

}

function impacto2(i) {

if (isNetscape) {

this.obj = eval("document.imp2" + i);

}

else {

this.obj = eval("imp2" + i + ".style");

   }

}

function disparo(i) {

this.X = -5;

this.Y = -5;

this.dx = 0;

this.dy = 0;

this.estado = 0;

if (isNetscape) {       

this.obj = eval("document.dis" + i);

}

else {

this.obj = eval("dis" + i + ".style");

   }

}

function ovni(i) {

this.X = -30;

this.Y = -30;

this.dx = 0;

this.dy = 0;

if (isNetscape) {      

this.obj = eval("document.ovn" + i);

}

else {

this.obj = eval("ovn" + i + ".style");

   }

}

function startanimate() {

setInterval("animate()", 32);

}

function MoveHandlerN(e) {

Xpos = e.pageX;

Ypos = e.pageY;  

return true;

}

function MoveHandlerIE() {

Xpos = window.event.x + document.body.scrollLeft;

Ypos = window.event.y + document.body.scrollTop;         

}

if (isNetscape) {

document.captureEvents(Event.MOUSEMOVE);

document.onMouseMove = MoveHandlerN;

}

else {

document.onmousemove = MoveHandlerIE;

}

function animate() {

var deltaX, deltaY, height, width;

if (activos) {

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

if (Xpos > ovnis[i].X) ovnis[i].dx += (i+1)/5;

else ovnis[i].dx -= (i+1)/5;

if (ovnis[i].dx > STOPACCEL) ovnis[i].dx = STOPACCEL;

if (-ovnis[i].dx > STOPACCEL) ovnis[i].dx = -STOPACCEL;

if (Ypos > ovnis[i].Y) ovnis[i].dy += (i+1)/5;

else ovnis[i].dy -= (i+1)/5;

if (ovnis[i].dy > STOPACCEL) ovnis[i].dy = STOPACCEL;

if (-ovnis[i].dy > STOPACCEL) ovnis[i].dy = -STOPACCEL;

ovnis[i].X += ovnis[i].dx;

ovnis[i].Y += ovnis[i].dy;

deltaX = Xpos - ovnis[i].X - 10;

deltaY = Ypos - ovnis[i].Y - 10;

if ((disparos[i].estado == 0) && ((Math.abs(deltaX) + (Math.abs(deltaY))) < 100)) {

disparos[i].dx = deltaX/10;

disparos[i].dy = deltaY/10;

disparos[i].estado++;

}

if ((disparos[i].estado > 0) && (disparos[i].estado < 12)) {

disparos[i].X += disparos[i].dx;

disparos[i].Y += disparos[i].dy;

disparos[i].estado++;

}

else {

if (disparos[i].estado != 0) {

impactoActual++;

if (impactoActual >= nImpactos) {

impactoActual = 1;

}

impactos2[0].obj.left = impactos[impactoActual].X + 5;

impactos2[0].obj.top = impactos[impactoActual].Y + 13;

impactos[impactoActual].X = disparos[i].X - 10;

impactos[impactoActual].Y = disparos[i].Y - 14;

impactos[impactoActual].obj.left = impactos[impactoActual].X;

impactos[impactoActual].obj.top = impactos[impactoActual].Y;

}

disparos[i].X = ovnis[i].X+10;

disparos[i].Y = ovnis[i].Y+10;

disparos[i].estado = 0;

}

if (isNetscape) {

height = window.innerHeight + document.scrollTop;

width = window.innerWidth + document.scrollLeft;

}

else {

height = document.body.clientHeight + document.body.scrollTop;

width = document.body.clientWidth + document.body.scrollLeft;

}

if (ovnis[i].Y >=  height - TAMOVNI - 1) {

if (ovnis[i].dy > 0) {

ovnis[i].dy = REBOTE * -ovnis[i].dy;

}

ovnis[i].Y = height - TAMOVNI - 1;

}

if (ovnis[i].X >= width - TAMOVNI) {

if (ovnis[i].dx > 0) {

ovnis[i].dx = REBOTE * -ovnis[i].dx;

}

ovnis[i].X = width - TAMOVNI - 1;

}

if (ovnis[i].X < 0) {

if (ovnis[i].dx < 0) {

ovnis[i].dx = REBOTE * -ovnis[i].dx;

}

ovnis[i].X = 0;

}

if (ovnis[i].Y < 0) {

if (ovnis[i].dy < 0) {

ovnis[i].dy = REBOTE * -ovnis[i].dy;

}

ovnis[i].Y = 0;

}

ovnis[i].obj.left = ovnis[i].X;

ovnis[i].obj.top =  ovnis[i].Y;

disparos[i].obj.left = disparos[i].X;

disparos[i].obj.top =  disparos[i].Y;

   }

}

else {

if (impactoActual != nImpactos+1)

{  //while the UFO's are off

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

ovnis[i].obj.left = -50;

ovnis[i].obj.top =  -50;

disparos[i].obj.left = -10;

disparos[i].obj.top =  -10;

}

for (i = 1;i < nImpactos;i++) {

impactos[i].obj.left = -20;

impactos[i].obj.top =  -20;

}

impactos2[0].obj.left = -20;

impactos2[0].obj.top =  -20;

impactoActual = nImpactos+1;

      }

   }

}

 

</script>

 

0 Comments

Fri

27

Feb

2009

153、图片转换效果

153、图片转换效果

脚本说明:

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

<SCRIPT language=JavaScript event=onload for=window>

//效果1

mylayer.filters[0].Apply();

mylayer.innerHTML = "<img src='0015.gif' align=center>";

mylayer.filters[0].Play();

///效果2

mylayer2.filters[0].Apply();

mylayer2.innerHTML = "<img src='0015.gif' align=center>";

mylayer2.filters[0].Play();

////效果3

mylayer3.filters[0].Apply();

mylayer3.innerHTML = "<img src='0015.gif' align=center>";

mylayer3.filters[0].Play();

 

</SCRIPT>

<DIV id=mylayer

style="FILTER: revealTrans(transition=16,duration=8); LEFT: 20px; WIDTH: 150px; POSITION: relative; TOP: 20px; HEIGHT: 150px; BACKGROUND-COLOR: white; TEXT-ALIGN: center"><IMG src="0016.gif"></DIV>

<DIV id=mylayer2

style="FILTER: blendTrans(duration=8); LEFT: 20px; WIDTH: 150px; POSITION: relative; TOP: 20px; HEIGHT: 150px; BACKGROUND-COLOR: white; TEXT-ALIGN: center"><IMG

src="0016.gif"></DIV>

<DIV id=mylayer3

style="FILTER: revealTrans(transition=3,duration=8); LEFT: 20px; WIDTH: 150px; POSITION: relative; TOP: 20px; HEIGHT: 150px; BACKGROUND-COLOR: white; TEXT-ALIGN: center"><IMG src="0016.gif"></DIV>

 

0 Comments

Fri

27

Feb

2009

152、广告banner效果

152、广告banner效果

脚本说明:

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

<SPAN id=imgcontainer1 style="HEIGHT: 19px; LEFT: 22px; POSITION: absolute; TOP: -65px; WIDTH: 721px"></SPAN>

<SPAN id=imgcontainer2 style="HEIGHT: 25px; LEFT: 13px; POSITION: absolute; TOP: -37px; WIDTH: 722px"></SPAN>

<SCRIPT>

<!-- Beginning of JavaScript -

 

// The width of your images (pixels). All pictures should have the same width.

var imgwidth=468

 

// The height of your images (pixels). All pictures should have the same height.

var imgheight=60

 

// The horizontal and vertical position of the images (pixels).

var pos_left=70

var pos_top=90

 

// The name of your images. You may add as many images as you like.

var imgname=new Array()

imgname[0]="home1.gif"

imgname[1]="home2.gif"

imgname[2]="home3.gif"

imgname[3]="home4.gif"

 

// Where should those images be linked to?

// Add an URL for each image.

// If you don't want to add an URL just write '#' instead of

// the URL, see sample imgurl[2].

var imgurl=new Array()

imgurl[0]="http://www.7stk.com"

imgurl[1]="http://www.7stk.com"

imgurl[2]="http://www.7syg.com"

imgurl[3]="http://www.7syg.com"

 

// This block will preload your images. Do not edit this block.

var imgpreload=new Array()

for (i=0;i<=imgname.length-1;i++) {

       imgpreload[i]=new Image()

       imgpreload[i].src=imgname[i]

}

 

// Standstill-time between the images (microseconds).

var pause=2000

 

// Speed of the stretching and shrinking effect. More means slower.

var speed=20

 

// This variable also affects the speed (the length of the step between each inmage-frame measured in pixels). More means faster.

var step=10

 

// Do not edit the script below

var i_loop=0

var i_image1=0

var i_image2=1

 

 

function stretchimage() {

       if (i_loop<=imgwidth) {

              if (document.all) {

                     imgcontainer1.innerHTML="<a href='"+imgurl[i_image1]+"' target='_blank'><img width='"+i_loop+"' height='"+imgheight+"' src='"+imgname[i_image1]+"' border='0'></a>"

                     document.all.imgcontainer2.style.posLeft=document.all.imgcontainer1.style.posLeft+i_loop

                    

                     imgcontainer2.innerHTML="<a href='"+imgurl[i_image2]+"' target='_blank'><img width='"+(imgwidth-i_loop)+"' height='"+imgheight+"' src='"+imgname[i_image2]+"' border='0'></a>"

              }

              i_loop=i_loop+step

              var timer=setTimeout("stretchimage()",speed)

      }

       else {

              clearTimeout(timer)

              changeimage()

       }

}

 

function changeimage() {

       i_loop=0

       i_image1++

       if (i_image1>imgname.length-1) {i_image1=0}

       i_image2=i_image1-1

       if (i_image2>imgname.length-1) {i_image2=0}

       if (i_image2<0) {i_image2=imgname.length-1}

      

       document.all.imgcontainer2.style.posLeft=document.all.imgcontainer1.style.posLeft

     var timer=setTimeout("stretchimage()",pause)

}

 

function initiate() {

       if (document.all) {

              document.all.imgcontainer1.style.posLeft=pos_left

              document.all.imgcontainer2.style.posLeft=pos_left

              document.all.imgcontainer1.style.posTop=pos_top

              document.all.imgcontainer2.style.posTop=pos_top

              changeimage()

       }

       if (document.layers) {

              document.imgcontainer1.left=pos_left

              document.imgcontainer2.left=pos_left

              document.imgcontainer1.top=pos_top

              document.imgcontainer2.top=pos_top

              rotatenetscape()

       }

}

 

function rotatenetscape() {

       document.imgcontainer1.document.write("<a href='"+imgurl[i_image1]+"' target='_blank'><img src='"+imgname[i_image1]+"' border='0'></a>")  

       document.imgcontainer1.document.close()  

       i_image1++

       if (i_image1>imgname.length-1) {i_image1=0}

     var timer=setTimeout("rotatenetscape()",pause*2)

}

 

// - End of JavaScript - -->

</SCRIPT>

 

 

 

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

<BODY bgcolor="#fef4d9" onload=initiate()>

 

0 Comments

Fri

27

Feb

2009

151、又一图片显示效果

151、又一图片显示效果

脚本说明:

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

<SCRIPT language=JavaScript1.1>

var photos=new Array()

var photoslink=new Array()

var which=0

photos[0]="047.gif"

photos[1]="048.gif"

photos[2]="049.gif"

photos[3]="050.gif"

photos[4]="051.gif"

photos[5]="052.gif"

var linkornot=0

photoslink[0]=""

photoslink[1]=""

photoslink[2]=""

photoslink[3]=""

photoslink[4]=""

photoslink[5]=""

var preloadedimages=new Array()

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

preloadedimages[i]=new Image()

preloadedimages[i].src=photos[i]

}

 

 

function applyeffect(){

if (document.all){

photoslider.filters.revealTrans.Transition=Math.floor(Math.random()*23)

photoslider.filters.revealTrans.stop()

photoslider.filters.revealTrans.apply()

}

}

 

 

 

function playeffect(){

if (document.all)

photoslider.filters.revealTrans.play()

}

 

function keeptrack(){

window.status="Image "+(which+1)+" of "+photos.length

}

 

 

function backward(){

if (which>0){

which--

applyeffect()

document.images.photoslider.src=photos[which]

playeffect()

keeptrack()

}

}

 

function forward(){

if (which<photos.length-1){

which++

applyeffect()

document.images.photoslider.src=photos[which]

playeffect()

keeptrack()

}

}

 

function transport(){

window.location=photoslink[which]

}

 

</SCRIPT>

<SCRIPT>

if (linkornot==1)

document.write('<a href="javascript:transport()">')

document.write('<img src="'+photos[0]+'" name="photoslider" style="filter:revealTrans(duration=2,transition=23)" border=0>')

if (linkornot==1)

document.write('</a>')

</SCRIPT><BR>

<A   href="#"    onclick="backward();return false">上一张</A>

<A  href="#" onclick="forward();return false">下一张</A>

 

0 Comments