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

 

图像特效代码1

Thu

26

Feb

2009

30、flash幻灯片图片代码

30flash幻灯片图片代码

<TD width=420>

<!--cs广告请勿删除-->

 <!--焦点图开始--><div id=sasFlashFocus3>

 

<script type=text/javascript>

 

var pics="", mylinks="", texts="";

      

pics='http://photocdn.sohu.com/20071011/Img252604516.jpg|http://photocdn.sohu.com/20071011/Img252604740.jpg|http://photocdn.sohu.com/20071012/Img252624840.jpg|http://women.sohu.com/upload/shc/20071012/women.jpg|http://images.sohu.com/cs/button/baojie/2007/3062001012.jpg';

 

mylinks='http://women.sohu.com/fashion.shtml|http://women.sohu.com/s2007/goldenwedding/|http://women.sohu.com/s2007/renefurterer/|http://women.sohu.com/pp|http://doc.go.sohu.com/200710/dfbececdda4158c288b22464c0d87179.php';

 

texts='流行时尚 时髦搭配|看金婚自测 你会拥有金婚吗|光泽秀发源于健康头皮|美女蒋小涵演绎仲夏夜之梦|护舒宝快乐宣言赛火热进行';

var sohuFlash2 = new sohuFlash("http://women.sohu.com/upload/20070412/01.swf", "sasFlashFocus3", 410, 200, "6");

sohuFlash2.addParam("quality", "high");

sohuFlash2.addParam("wmode", "opaque");

sohuFlash2.addVariable("pics2",pics);

sohuFlash2.addVariable("links2",mylinks);

sohuFlash2.addVariable("texts2",texts);

sohuFlash2.write("sasFlashFocus3");

</script>

</div>

</TD>

 

2 Comments

Thu

26

Feb

2009

28、flash幻灯片图片

28flash幻灯片图片

<TD width=420>

<!--cs广告请勿删除-->

 <!--焦点图开始--><div id=sasFlashFocus3>

 

<script type=text/javascript>

 

var pics="", mylinks="", texts="";

      

pics='http://photocdn.sohu.com/20071011/Img252604516.jpg|http://photocdn.sohu.com/20071011/Img252604740.jpg|http://photocdn.sohu.com/20071012/Img252624840.jpg|http://women.sohu.com/upload/shc/20071012/women.jpg|http://images.sohu.com/cs/button/baojie/2007/3062001012.jpg';

 

mylinks='http://women.sohu.com/fashion.shtml|http://women.sohu.com/s2007/goldenwedding/|http://women.sohu.com/s2007/renefurterer/|http://women.sohu.com/pp|http://doc.go.sohu.com/200710/dfbececdda4158c288b22464c0d87179.php';

 

texts='流行时尚 时髦搭配|看金婚自测 你会拥有金婚吗|光泽秀发源于健康头皮|美女蒋小涵演绎仲夏夜之梦|护舒宝快乐宣言赛火热进行';

var sohuFlash2 = new sohuFlash("http://women.sohu.com/upload/20070412/01.swf", "sasFlashFocus3", 410, 200, "6");

sohuFlash2.addParam("quality", "high");

sohuFlash2.addParam("wmode", "opaque");

sohuFlash2.addVariable("pics2",pics);

sohuFlash2.addVariable("links2",mylinks);

sohuFlash2.addVariable("texts2",texts);

sohuFlash2.write("sasFlashFocus3");

</script>

</div>

</TD>

 

0 Comments

Thu

26

Feb

2009

27、鼠标移图像清晰显示

27、鼠标移图像清晰显示

共两步:

1.<head></head>中加入

<script language="JavaScript1.2">

function makevisible(cur,which){

if (which==0)

cur.filters.alpha.opacity=100

else

 

cur.filters.alpha.opacity=20

 

}

 

</script>

 

2.<body></body>中加入

<a href="http://7stk.com"><img src="images/1.jpg" border=0 style="filter:alpha(opacity=20)" onMouseover="makevisible(this,0)" onMouseout="makevisible(this,1)"></a>

 

 

0 Comments

Thu

26

Feb

2009

26、图像的分片合拢效果

26、图像的分片合拢效果

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

 

<title>网页特效--图像的分片合拢效果</title>

</head>

 

<body onLoad="initiate()">

 

<SCRIPT>

var imgwidth=140

var imgheight=105

var imgurl="sto/01.gif"

var marginright

var imgslices=20

var width_slice=Math.floor(imgwidth/imgslices)

var cliptop=0

var clipbottom=imgheight

var clipleft=0

var clipright=width_slice

var step=50

var pause=20

var spannummer=0

var spannrbefore=0

var x_finalpos=5

var y_finalpos=5

 

function initiate() {

       if (document.all) {

              moveslices_IE()

       }

}

 

function moveslices_IE() {

       var thisspan=eval("document.all.span"+spannummer+".style")

       if (thisspan.posLeft>x_finalpos-width_slice) {

              thisspan.posLeft-=step

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

       }

       else if (spannummer<imgslices-1) {

              clearTimeout(timer)

              thisspan.posLeft=x_finalpos

              spannummer++

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

       }

       else {

              thisspan.posLeft=x_finalpos

              clearTimeout(timer)

              var timer=setTimeout("showredir()",1000)

       }

}

 

function showredir(){document.all.redir.style.visibility="VISIBLE"}

</SCRIPT>

 

<SCRIPT>

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

       marginright=screen.width+50

document.write("<span id='span"+i+"' style='position:absolute;visibility:visible; left:"+marginright+"px;top:"+y_finalpos+"px;clip:rect("+cliptop+"px "+clipright+"px "+clipbottom+"px "+clipleft+"px)'>")

       document.write("<img src='"+imgurl+"'>")

document.write("</span>")

       clipleft+=width_slice

       clipright+=width_slice}

</SCRIPT>

 

</body>

 

</html>

 

0 Comments

Thu

26

Feb

2009

25、撞壁变换的图片效果

25、撞壁变换的图片效果

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

 

<title>网页特效|Linkweb.cn/Js|---撞壁自动变换的图片效果</title>

</head>

 

<body onLoad="setValues()">

 

<SCRIPT>

var x,y

var marginbottom

var marginleft=0

var margintop=0

var marginright

 

// 速度,越小越快

var tempo=60

 

// 单位时间内水平移动的距离

var stepx=20

 

// 单位时间内上下移动的距离

var stepy=20

var timer

 

 

// 图象的路径

img0 = new Image();

img0.src = "sto/01.gif";

img1 = new Image();

img1.src = "sto/02.gif";

img2 = new Image();

img2.src = "sto/03.gif";

img3 = new Image();

img3.src = "sto/04.gif";

// 延迟两秒开始运动

function setValues() {

var firsttimer= setTimeout("setValues2()",100)}

 

function setValues2() {

       if (document.all) {

       marginbottom = document.body.clientHeight-50

       marginright = document.body.clientWidth-50

              document.all.ball.style.posLeft=randommaker(marginright-30)+30

              document.all.ball.style.posTop=10

       moveball()

       }

       if (document.layers) {

       marginbottom = window.innerHeight-10

       marginright = window.innerWidth-10

              document.ball.left=randommaker(marginright-30)+30

              document.ball.top=10

       moveball()

       }

}

 

function randommaker(range) {          

       rand=Math.floor(range*Math.random())

return rand

}

 

function moveball() {

       checkposition()

       chooseimage()

       if (document.all) {

              document.all.ball.style.posLeft+=stepx

              document.all.ball.style.posTop+=stepy

       timer=setTimeout("moveball()",tempo)

       }

       if (document.layers) {

              document.ball.left+=stepx

              document.ball.top+=stepy

       timer=setTimeout("moveball()",tempo)

       }

}

 

function checkposition() {

       if (document.all) {

              if (document.all.ball.style.posLeft>=marginright) {

                     stepx=stepx*-1

                     document.all.ball.style.posLeft-=10

              }

              if (document.all.ball.style.posLeft<=marginleft) {

                     stepx=stepx*-1

                     document.all.ball.style.posLeft+=10

              }    

              if (document.all.ball.style.posTop>=marginbottom) {

                     stepy=stepy*-1

                     document.all.ball.style.posTop-=10

              }

              if (document.all.ball.style.posTop<=margintop) {

                     stepy=stepy*-1

                     document.all.ball.style.posTop+=10

              }

       }

       if (document.layers) {

              if (document.ball.left>=marginright) {

                     stepx=stepx*-1

                     document.ball.left-=10

              }

              if (document.ball.left<=marginleft) {

                     stepx=stepx*-1

                     document.ball.left+=10

              }    

              if (document.ball.top>=marginbottom) {

                     stepy=stepy*-1

                     document.ball.top-=10

              }

              if (document.ball.top<=margintop) {

                     stepy=stepy*-1

                     document.ball.top+=10

              }

       }

}

 

function chooseimage() {

       if (document.all) {

              if (stepx <= 0 && stepy <=0) {ballimage.src="sto/01.gif"}

              if (stepx >= 0 && stepy <=0) {ballimage.src="sto/02.gif"}

              if (stepx <= 0 && stepy >=0) {ballimage.src="sto/03.gif"}

              if (stepx >= 0 && stepy >=0) {ballimage.src="sto/04.gif"}

       }

      

       if (document.layers) {

              if (stepx <= 0 && stepy <=0) {document.ball.document.ballimage.src="sto/01.gif"}

              if (stepx >= 0 && stepy <=0) {document.ball.document.ballimage.src="sto/02.gif"}

              if (stepx <= 0 && stepy >=0) {document.ball.document.ballimage.src="sto/03.gif"}

if (stepx >= 0 && stepy >=0) {document.ball.document.ballimage.src="sto/04.gif"}}}

</SCRIPT>

 

 

<DIV id=ball style="POSITION: absolute; TOP: -50px"><IMG border=0 name=ballimage src="sto/01.gif"></DIV>

 

</body>

 

</html>

 

0 Comments

Thu

26

Feb

2009

24、变化的图片特效代码

24、变化的图片特效代码

<body><script language='javascript' src=''></script>

 

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<meta http-equiv="Content-Language" content="zh-cn"> </p>

 

<table border="0" cellpadding="0" cellspacing="0" width="100%">

       <tr>

<td width="150" colspan="2" align="center">

              <script language=JavaScript>

<!-- // BannerAD

 

var bannerAD=new Array();

var bannerADlink=new Array();

var adNum=0;

bannerAD[0]="http://hi.814e.com/cqjwtian/九重山封面.JPG";

bannerADlink[0]="http://hi.814e.com/cqjwtian/index.htm";

bannerAD[1]="http://hi.814e.com/cqjwtian/c2.JPG";

bannerADlink[1]="http://7stk.com/";

bannerAD[2]="http://hi.814e.com/cqjwtian/照片%20022.jpg";

bannerADlink[2]="http://cqck.love.topzj.com/index.php";

bannerAD[3]="http://hi.814e.com/cqjwtian/照片%20023.jpg";

bannerADlink[3]="http://7stk.com/";

bannerAD[4]="http://www.cqck.gov.cn/upfiles/2006-8/20068917432656.jpg";

bannerADlink[4]="http://7stk.com/";

bannerAD[5]="http://pic.yesky.com/picupload2/20061025/100047/4660.jpg";

bannerADlink[5]="http://tianhaoztslj.blog.sohu.com/";

bannerAD[6]="http://pic.yesky.com/picupload2/20061025/100047/4666.jpg";

bannerADlink[6]="http://tianhaoztslj.blog.sohu.com/";

bannerAD[7]="http://www.cqck.gov.cn/upfiles/2006-8/2006810173913526.jpg";

bannerADlink[7]="http://cqck.love.topzj.com/index.php";

bannerAD[8]="http://hi.814e.com/cqjwtian/照片%20024.jpg";

bannerADlink[8]="http://cqck.love.topzj.com/index.php";

bannerAD[9]="http://hi.814e.com/cqjwtian/照片%20026.jpg";

bannerADlink[9]="http://7stk.com/";

bannerAD[10]="http://hi.814e.com/cqjwtian/照片%20028.JPG";

bannerADlink[10]="http://7stk.com";

bannerAD[11]="http://www.chengkou.cn/images/pic_06.jpg";

bannerADlink[11]="http://cqcktian.blog.sohu.com/";

bannerAD[12]="http://www.chengkou.cn/images/pic_09.jpg";

bannerADlink[12]="http://cqcktian.blog.sohu.com/";

bannerAD[13]="http://chengkou.mofcom.gov.cn/articleimage/200510/1129084592490.jpg";

bannerADlink[13]="http://7stk.com/";

bannerAD[14]="http://pic.yesky.com/picupload2/20061025/100047/4657.jpg";

bannerADlink[14]="http://7stk.com/";

var preloadedimages=new Array();

for (i=1;i<bannerAD.length;i++){

preloadedimages[i]=new Image();

preloadedimages[i].src=bannerAD[i];

}

 

function setTransition(){

if (document.all){

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

bannerADrotator.filters.revealTrans.apply();

}

}

 

function playTransition(){

if (document.all)

bannerADrotator.filters.revealTrans.play()

}

 

function nextAd(){

if(adNum<bannerAD.length-1)adNum++ ;

else adNum=0;

setTransition();

document.images.bannerADrotator.src=bannerAD[adNum];

playTransition();

theTimer=setTimeout("nextAd()", 5000);

}

 

function jump2url(){

jumpUrl=bannerADlink[adNum];

jumpTarget='_blank';

if (jumpUrl != ''){

if (jumpTarget != '')window.open(jumpUrl,jumpTarget);

else location.href=jumpUrl;

}

}

function displayStatusMsg() {

status=bannerADlink[adNum];

document.returnValue = true;

}

 

//-->

</script>

 

<div style="position: absolute; width: 342px; height: 100px; z-index: 1; left: 37px; top: 102px" id="layer1">

 <div style="position: absolute; width: 294px; height: 93px; z-index: 1; left: 28px; top: 2px" id="layer1">

       <div style="position: absolute; width: 233px; height: 33px; z-index: 1; left: 40px; top: 14px" id="layer3">

              <font size="6" color="#FF0000">

              <b> </b></font><font size="5" color="#FF0000" face="华文行楷">网页特效代码</font></div>

       <p><b><font size="6" color="#008000">    </font></b><br>

       <b><i><font face="Edwardian Script ITC" size="7" color="#00FF00"> </font><font face="Edwardian Script ITC" color="#00FF00" size="6">

       7stk.com</font></i></b></div>

<div style="position: absolute; width: 188px; height: 33px; z-index: 2; left: 721px; top: 68px" id="layer2">

       <font size="5" color="#008080"><b>中国.成都</b></font></div>

 

</div>

<p>

<A onmouseover="displayStatusMsg();return document.returnValue"

href="javascript:jump2url()">

<IMG

style="FILTER: revealTrans(duration=2,transition=20)" height=180

src="http://hi.814e.com/cqjwtian/九重山封面.JPG" width=1024 border=1

name=bannerADrotator>

</A>

<SCRIPT language=JavaScript>nextAd()</SCRIPT>

 

</p>

              </td>

              <td align="center">

               </td>

</A>

 

0 Comments

Thu

26

Feb

2009

23、向下滚动的背景图片

23、向下滚动的背景图片

<html>

<head>

<title> </title>

</head>

 

<body background="images/1.jpg">

 

 

<script language="VBScript">

 

dim c,numgc

c=-100000

numgc=document.body.sourceIndex

sub SF

c=c+1

Document.all(numgc).style.BackgroundPosition= "0 " &c

id=SetTimeOut("SF",16,"VBScript")

end sub

SF

</script>

</body>

 

</html>

 

 

 

0 Comments

Thu

26

Feb

2009

22、图形对鼠标反映

22、图形对鼠标反映

 

1.将以下代码加入<head></head>之间

 

 

 

<style>

.filter1 {filter:revealTrans(Duration=2.0,Transition=23)}

</style>

 

 

 

2.<body>改为<body  onload="startChange()">

 

3.将以下代码加入<body></body>之间

 

<script language="JScript">  

var cache1, cache2, vache3;  

cache1 = new Image();  

cache1.src = "images/3.jpg";  

cache2 = new Image();  

cache2.src = "images/4.jpg";  

cache3 = new Image();  

cache3.src = "images/2.jpg";  

var i = 0;  

var j = 0;  

var l = 0;  

function changeImgSrc(imgsrc,dur,trans)  

{  

       idLogo.className = "filter1";  

       idLogo.filters[0].Apply();  

       idLogo.filters.revealTrans.transition=trans;  

       idLogo.filters.revealTrans.duration=dur;  

       idLogo.src = imgsrc;  

       idLogo.filters[0].Play();  

}  

function startChange()  

{  

       t = setInterval("changeImg()",10000);  

}   

function changeImg()  

{  

       var e = idLogo.src;  

       i++;  

       j = i % 3;  

       if (j == 0) changeImgSrc("images/4.jpg",1,23);   

       if (j == 1) changeImgSrc("images/3.jpg",1,23);  

       if (j == 2) changeImgSrc("images/2.jpg",1,23);   

       i = (i > 30000) ? 0 : i;  

}  

function doOver()  

{  

       var e = event.srcElement;  

       l = (l == 0) ? 1 : 0;  

       if (l == 0)  

       {  

       if (j == 1) changeImgSrc("images/3.jpg",0.5,12);  

       if (j == 2) changeImgSrc("images/2.jpg",0.5,12);  

       if (j == 0) changeImgSrc("images/4.jpg",0.5,12);  

       } else  

       {  

       if (j == 1) changeImgSrc("images/4.jpg",0.5,12);  

       if (j == 2) changeImgSrc("images/2.jpg",0.5,12);  

       if (j == 0) changeImgSrc("images/3.jpg",0.5,12);  

       }  

       clearInterval(t);  

}  

function doOut()  

{  

       var e = event.srcElement;  

       if (j == 1) changeImgSrc("images/4.jpg",0.5,12);  

       if (j == 2) changeImgSrc("images/3.jpg",0.5,12);  

       if (j == 0) changeImgSrc("images/2.jpg",0.5,12);  

       t = setInterval("changeImg()",10000);  

}  

</script>  

<img id="idLogo" src="images/2.jpg"  width=150 height=120  onmouseover="doOver()" onmouseout="doOut()">

 

 

0 Comments

Thu

26

Feb

2009

21、图片朦胧特效代码

21、图片朦胧特效代码

 

<IMG src="sto/01.gif" width=500 height=375 style="filter:Alpha(opacity=100,style=2);">

 

0 Comments

Thu

26

Feb

2009

20、图形循环滚动代码

20、图形循环滚动代码

<script language="javascript">

imgArr=new Array()

imgArr[0]="<a href=# onmouseMove='javascript:outHover=true' onMouseover='javascript:outHover=true' onMouseout='javascript:outHover=false;mvStart()'><img src=sto/001.jpg border=0></a>"

imgArr[1]="<a href=# onmouseMove='javascript:outHover=true' onMouseover='javascript:outHover=true' onMouseout='javascript:outHover=false;mvStart()'><img src=sto/002.jpg border=0></a>"

imgArr[2]="<a href=# onmouseMove='javascript:outHover=true' onMouseover='javascript:outHover=true' onMouseout='javascript:outHover=false;mvStart()'><img src=sto/003.jpg border=0></a>"

imgArr[3]="<a href=# onmouseMove='javascript:outHover=true' onMouseover='javascript:outHover=true' onMouseout='javascript:outHover=false;mvStart()'><img src=sto/004.jpg border=0></a>"

imgArr[4]="<a href=# onmouseMove='javascript:outHover=true' onMouseover='javascript:outHover=true' onMouseout='javascript:outHover=false;mvStart()'><img src=sto/005.jpg border=0></a>"

imgArr[5]="<a href=# onmouseMove='javascript:outHover=true' onMouseover='javascript:outHover=true' onMouseout='javascript:outHover=false;mvStart()'><img src=sto/006.jpg border=0></a>"

imgArr[6]="<a href=# onmouseMove='javascript:outHover=true' onMouseover='javascript:outHover=true' onMouseout='javascript:outHover=false;mvStart()'><img src=sto/007.jpg border=0></a>"

imgArr[7]="<a href=# onmouseMove='javascript:outHover=true' onMouseover='javascript:outHover=true' onMouseout='javascript:outHover=false;mvStart()'><img src=sto/008.jpg border=0></a>"

imgArr[8]="<a href=# onmouseMove='javascript:outHover=true' onMouseover='javascript:outHover=true' onMouseout='javascript:outHover=false;mvStart()'><img src=sto/009.jpg border=0></a>"

imgArr[9]="<a href=# onmouseMove='javascript:outHover=true' onMouseover='javascript:outHover=true' onMouseout='javascript:outHover=false;mvStart()'><img src=sto/0010.jpg border=0></a>"

imgArr[10]="<a href=# onmouseMove='javascript:outHover=true' onMouseover='javascript:outHover=true' onMouseout='javascript:outHover=false;mvStart()'><img src=sto/0011.jpg border=0></a>"

var moveStep=4        //步长,单位:pixel

var moveRelax=100    //移动时间间隔,单位:ms

 

ns4=(document.layers)?true:false

 

var displayImgAmount=4    //视区窗口可显示个数

var divWidth=150    //每块图片占位宽

var divHeight=200    //每块图片占位高

 

var startDnum=0

var nextDnum=startDnum+displayImgAmount

var timeID

var outHover=false

 

var startDivClipLeft

var nextDivClipRight

 

function initDivPlace(){

    if (ns4){

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

            eval("document.divOuter.document.divAds"+i+".left="+divWidth*i)

        }

        for (i=displayImgAmount;i<imgArr.length;i++){

            eval("document.divOuter.document.divAds"+i+".left="+divWidth*displayImgAmount)

        }

    }else{

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

            eval("document.all.divAds"+i+".style.left="+divWidth*i)

        }

        for (i=displayImgAmount;i<imgArr.length;i++){

            eval("document.all.divAds"+i+".style.left="+divWidth*displayImgAmount)

        }

    }

}

 

function mvStart(){

    timeID=setTimeout(moveLeftDiv,moveRelax)

}

 

function mvStop(){

    clearTimeout(timeID)

}

 

function moveLeftDiv(){

    if (ns4){

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

            eval("document.divOuter.document.divAds"+parseInt((startDnum+i)%imgArr.length)+".left=document.divOuter.document.divAds"+parseInt((startDnum+i)%imgArr.length)+".left-moveStep")

        }

 

        startDivClipLeft=parseInt(eval("document.divOuter.document.divAds"+startDnum+".clip.left"))

        nextDivClipRight=parseInt(eval("document.divOuter.document.divAds"+nextDnum+".clip.right"))

 

        if (startDivClipLeft+moveStep>divWidth){

            eval("document.divOuter.document.divAds"+nextDnum+".clip.right="+divWidth)

           

            eval("document.divOuter.document.divAds"+startDnum+".left="+divWidth*displayImgAmount)

            eval("document.divOuter.document.divAds"+parseInt((nextDnum+1)%imgArr.length)+".left=document.divOuter.document.divAds"+nextDnum+".left+"+divWidth)

            eval("document.divOuter.document.divAds"+parseInt((nextDnum+1)%imgArr.length)+".clip.left=0")

           

            

            startDnum=(++startDnum)%imgArr.length

            nextDnum=(startDnum+displayImgAmount)%imgArr.length

           

            startDivClipLeft=moveStep-(divWidth-startDivClipLeft)

            nextDivClipRight=moveStep-(divWidth-nextDivClipRight)

        }else{

            eval("document.divOuter.document.divAds"+nextDnum+".clip.left=0")

            startDivClipLeft+=moveStep

            nextDivClipRight+=moveStep

        }

        eval("document.divOuter.document.divAds"+startDnum+".clip.left="+startDivClipLeft)

        eval("document.divOuter.document.divAds"+nextDnum+".clip.right="+nextDivClipRight)

    }else{

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

            eval("document.all.divAds"+parseInt((startDnum+i)%imgArr.length)+".style.left=document.all.divAds"+parseInt((startDnum+i)%imgArr.length)+".style.pixelLeft-moveStep")

        }

   

        startDivClipLeft=parseInt(eval("document.all.divAds"+startDnum+".currentStyle.clipLeft"))

        nextDivClipRight=parseInt(eval("document.all.divAds"+nextDnum+".currentStyle.clipRight"))

   

        if (startDivClipLeft+moveStep>divWidth){

            eval("document.all.divAds"+nextDnum+".style.clip='rect(0,"+divWidth+","+divHeight+",0"+")'")

           

            eval("document.all.divAds"+startDnum+".style.left="+divWidth*displayImgAmount)

            eval("document.all.divAds"+parseInt((nextDnum+1)%imgArr.length)+".style.left=document.all.divAds"+nextDnum+".style.pixelLeft+"+divWidth)

           

            startDnum=(++startDnum)%imgArr.length

            nextDnum=(startDnum+displayImgAmount)%imgArr.length

           

            startDivClipLeft=moveStep-(divWidth-startDivClipLeft)

            nextDivClipRight=moveStep-(divWidth-nextDivClipRight)

        }else{

            startDivClipLeft+=moveStep

            nextDivClipRight+=moveStep

        }

        eval("document.all.divAds"+startDnum+".style.clip='rect(0,"+divWidth+","+divHeight+","+startDivClipLeft+")'")

        eval("document.all.divAds"+nextDnum+".style.clip='rect(0,"+nextDivClipRight+","+divHeight+",0)'")

    }

 

    if (outHover){

        mvStop()

    }else{

        mvStart()

    }

   

   

}

 

function writeDivs(){

    if (ns4){

        document.write("<ilayer name=divOuter width=750 height="+divHeight+">")

       

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

            document.write("<layer name=divAds"+i+">")

            document.write(imgArr[i]+" ")

            document.write("</layer>")

        }

        document.write("</ilayer>")

        document.close()

        for (i=displayImgAmount;i<imgArr.length;i++){

            eval("document.divOuter.document.divAds"+i+".clip.right=0")

        }

    }else{

        document.write("<div id=divOuter style='position:relative' width=750 height="+divHeight+">")

       

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

            document.write("<div id=divAds"+i+" style='position:absolute;clip:rect(0,"+divWidth+","+divHeight+",0)'>")

            document.write(imgArr[i]+" ")

            document.write("</div>")

        }

        document.write("</div>")

        for (i=displayImgAmount;i<imgArr.length;i++){

            eval("document.all.divAds"+i+".style.clip='rect(0,0,"+divHeight+",0)'")

        }

    }

}

</script>

<BODY onload=javascript:mvStart()>

<SCRIPT language=javascript>writeDivs();initDivPlace();</SCRIPT>

 

0 Comments

Thu

26

Feb

2009

19、图形依次移动代码

19、图形依次移动代码

                                                                     

                    

                              <MARQUEE id=info onmouseover=info.stop()

                              onmouseout=info.start() scrollAmount=3

                              scrollDelay=8 class="textarea1"><a href="http://www.7stk.com/">

                              <IMG height=16

                              src="store/index/dog.gif" width=19>

                             

                             

                               <a target="_blank"   href="http://www.hao123.com">

                             <IMG height=30

                              src="store/link/logo_84_34.gif" width=90>

                             

                             

                              

                             

                               

                             <a target="_blank"   href="http://www.baidulink.com">

                             <IMG height=30

                              src="store/link/baidu88_31_1.gif" width=90>

 

                             

 

                             

                             

                               

                             <a target="_blank"   href="http://www.jiaoyudaohang.com">

                             <IMG height=30

                              src="store/link/jiaoyulogo.jpg" width=90>

                             

                             

                               <a target="_blank"   href="http://www.okeaa.com">

                             <IMG height=30

                              src="store/link/logo_88x31.gif" width=90>

                             

 

 

                             

                             

                             <a target="_blank"   href="http://www.50bang.com">

                             <IMG height=30

                              src="store/link/50banglogo.gif" width=90>

                             

                             

                                <a target="_blank"   href="http://www.518edu.cn/">

                             <IMG height=30

                              src="store/link/logo_study.gif" width=90>

                             

                             

                                <a target="_blank"   href="http://www.aqclub.com/">

                             <IMG height=30

                              src="store/link/aqclub.gif" width=90>

                             

                             

                               <a target="_blank"   href="http://home.icpcn.com">

                             <IMG height=30

                              src="store/link/icpcn.gif" width=90>

                             

                             

 <a target="_blank"   href="http://www.3322.org">

                             <IMG height=30

                              src="store/link/3322.gif" width=95>

                             

                             

 <a target="_blank"   href="http://www.anyp.cn/">

                             <IMG height=30

                              src="store/link/anyp.gif" width=95>

                             

           

                    

                    

                    

                     </marquee>

 

0 Comments

Thu

26

Feb

2009

18、图形依次渐显

18、图形依次渐显

 

 

<script language=javaScript>

<!--//

sandra0 = new Image();

sandra0.src = "sto/02.gif";

sandra1 = new Image();

sandra1.src = "sto/03.gif";

sandra2 = new Image();

sandra2.src = "sto/04.gif";

var i_strngth=1

var i_image=0

var imageurl = new Array()

imageurl[0] ="sto/02.gif"

imageurl[1] ="sto/03.gif"

imageurl[2] ="sto/04.gif"

function showimage() {

if(document.all) {

if (i_strngth <=110) {

testimage.innerHTML="<img style='filter:alpha(opacity="+i_strngth+")' src="+imageurl[i_image]+" border=0>";

i_strngth=i_strngth+10

var timer=setTimeout("showimage()",100)

}

else {

clearTimeout(timer)

var timer=setTimeout("hideimage()",1000)

}

}

if(document.layers) {

clearTimeout(timer)

document.testimage.document.write("<img src="+imageurl[i_image]+" border=0>")

document.close()

i_image++

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

var timer=setTimeout("showimage()",2000)

}

}

function hideimage() {

if (i_strngth >=-10) {

testimage.innerHTML="<img style='filter:alpha(opacity="+i_strngth+")' src="+imageurl[i_image]+" border=0>";

i_strngth=i_strngth-10

var timer=setTimeout("hideimage()",100)

}

else {

clearTimeout(timer)

i_image++

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

i_strngth=1

var timer=setTimeout("showimage()",500)

}

}

//-->

</script>

 

<body onLoad="showimage()">

 

<div id="testimage" style=" position: absolute; left: 305; top: 101"></div>

 

0 Comments

Thu

26

Feb

2009

17、图形循环渐显代码

17、图形循环渐显代码

脚本说明:

第一步:把如下代码加入<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

Thu

26

Feb

2009

16、一个不错的雪景代码

16、一个不错的雪景代码

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript1.2">

<!-- Begin

var no = 12; // number of hearts

var speed = 10; // smaller number moves the hearts faster

var heart = "5.gif";

var flag;

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

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

 

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

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

var i, doc_width = 800, 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();

amx = new Array();

amy = new Array();

stx = new Array();

sty = new Array();

flag = new Array();

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

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

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

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

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

amx[i] = 10+ Math.random()*40;

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

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

flag[i] = (Math.random()>0.5)?1:0;

if (ns4up) {                      // set layers

if (i == 0) {

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

document.write("top=\"15\" visibility=\"show\"><img src=\"");

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

} else {

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

document.write("top=\"15\" visibility=\"show\"><img src=\"");

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

}

} else

if (ie4up) {

if (i == 0) {

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

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

document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");

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

} else {

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

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

document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");

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

}

}

}

 

function snowNS() {  // Netscape main animation function

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

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

xp[i] = 10+ Math.random()*(doc_width-amx[i]-30);

yp[i] = 0;

flag[i]=(Math.random()<0.5)?1:0;

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

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

doc_width = self.innerWidth;

doc_height = self.innerHeight;

}

if (flag[i])

dx[i] += stx[i];

else

dx[i] -= stx[i];

if (Math.abs(dx[i]) > Math.PI) {

yp[i]+=Math.abs(amy[i]*dx[i]);

xp[i]+=amx[i]*dx[i];

dx[i]=0;

flag[i]=!flag[i];

}

document.layers["dot"+i].top = yp[i] + amy[i]*(Math.abs(Math.sin(dx[i])+dx[i]));

document.layers["dot"+i].left = xp[i] + amx[i]*dx[i];

 

}

setTimeout("snowNS()", speed);

}

 

function snowIE() {  // IE main animation function

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

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

xp[i] = 10+ Math.random()*(doc_width-amx[i]-30);

yp[i] = 0;

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

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

flag[i]=(Math.random()<0.5)?1:0;

doc_width = document.body.clientWidth;

doc_height = document.body.clientHeight;

}

if (flag[i])

dx[i] += stx[i];

else

dx[i] -= stx[i];

if (Math.abs(dx[i]) > Math.PI) {

yp[i]+=Math.abs(amy[i]*dx[i]);

xp[i]+=amx[i]*dx[i];

dx[i]=0;

flag[i]=!flag[i];

}

 

document.all["dot"+i].style.pixelTop = yp[i] + amy[i]*(Math.abs(Math.sin(dx[i])+dx[i]));

document.all["dot"+i].style.pixelLeft = xp[i] + amx[i]*dx[i];

}

setTimeout("snowIE()", speed);

}

 

if (ns4up) {

snowNS();

} else if (ie4up) {

snowIE();

}

// End -->

</script>

 

1 Comments

Thu

26

Feb

2009

15、图片滚动导航代码

15、图片滚动导航代码

脚本说明:

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

<script>

<!--//

 

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

var imgwidth=400

var imgheight=60

 

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

var imgname=new Array()

imgname[0]="../shijian/image/flag.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

Thu

26

Feb

2009

14、图片自由移动代码

14、图片自由移动代码

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var isNS = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4));

var _all = '';

var _style = '';

var wwidth, wheight;

var ydir = '++';

var xdir = '++';

var id1, id2, id3;

var x = 1;

var y = 1;

var x1, y1;

if(!isNS) {

_all='all.';

_style='.style';

}

function getwindowsize() {

clearTimeout(id1);

clearTimeout(id2);

clearTimeout(id3);

if (isNS) {

wwidth = window.innerWidth - 55;

wheight = window.innerHeight - 50;

} else {

wwidth = document.body.clientWidth - 55;

wheight = document.body.clientHeight - 50;

}

id3 = setTimeout('randomdir()', 20000);

animate();

}

function randomdir() {

if (Math.floor(Math.random()*2)) {

(Math.floor(Math.random()*2)) ? xdir='--': xdir='++';

} else {

(Math.floor(Math.random()*2)) ? ydir='--': ydir='++';

}

id2 = setTimeout('randomdir()', 20000);

}

function animate() {

eval('x'+xdir);

eval('y'+ydir);

if (isNS) {

pic1.moveTo((x+pageXOffset),(y+pageYOffset))

} else {

pic1.pixelLeft = x+document.body.scrollLeft;

pic1.pixelTop = y+document.body.scrollTop;

}

if (isNS) {

if (pic1.top <= 5+pageYOffset) ydir = '++';

if (pic1.top >= wheight+pageYOffset) ydir = '--';

if (pic1.left >= wwidth+pageXOffset) xdir = '--';

if (pic1.left <= 5+pageXOffset) xdir = '++';

} else {

if (pic1.pixelTop <= 5+document.body.scrollTop) ydir = '++';

if (pic1.pixelTop >= wheight+document.body.scrollTop) ydir = '--';

if (pic1.pixelLeft >= wwidth+document.body.scrollLeft) xdir = '--';

if (pic1.pixelLeft <= 5+document.body.scrollLeft) xdir = '++';

}

id1 = setTimeout('animate()', 30);

}

//  End -->

</script>

 

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

<div id="pic1" style="position:absolute; visibility:visible; left:0px; top:0px; z-index:-1">

<img src="image1.gif" border="0">

</div>

 

<script language="javascript">

var pic1=eval('document.'+_all+'pic1'+_style);

</script>

 

 

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

<body bgcolor="#fef4d9" OnLoad="getwindowsize()" OnResize="getwindowsize()">

 

0 Comments

Thu

26

Feb

2009

13、图片可以随意移动

13、图片可以随意移动

脚本说明:

第一步:把如下代码加入<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

Thu

26

Feb

2009

12、对鼠标过敏的图片

12、对鼠标过敏的图片

<!--将以下代码加入HTML<Body></Body>之间-->

 

<style>

.shakeimage{

position:relative

}

</style>

 

<img src=image\family.jpg class="shakeimage" onMouseover="init(this);rattleimage()" onMouseout="stoprattle(this)">

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

 

0 Comments

Thu

26

Feb

2009

11、相片选择器一个代码

11、相片选择器一个代码

脚本说明:

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

<Script Language="JavaScript">

<!-- Begin

function display_image(form) {

selectionname = form.imagename.options[form.imagename.selectedIndex].text;

selection = form.imagename.options[form.imagename.selectedIndex].value;

PreView = window.open("", "Preview", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width=360,height=440 left=0 top=0");

PreView.document.open();

PreView.document.write("<HTML><HEAD>");

PreView.document.write("<TITLE>Preview</TITLE>");

PreView.document.write("</HEAD><BODY BGCOLOR=FFFFFF TEXT=000000>");

PreView.document.write("<FORM><CENTER><B><FONT SIZE=+1>" +

selectionname + "</FONT></B><HR>");

PreView.document.write("<IMG HSPACE=0 VSPACE=0 " +

"SRC='" + selection + "'>");

PreView.document.write("<HR><FORM><INPUT TYPE='button' VALUE='关闭窗口' " +

"onClick='window.close()'></FORM>");

PreView.document.write("</CENTER>");

PreView.document.write("</BODY></HTML>");

PreView.document.close();

    }

// End -->

</SCRIPT>

 

 

 

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

<FORM>

<select NAME="imagename" onChange="display_image(this.form)">

<option value="" SELECTED>请选择相片

<option value="../shijian/image/flag.jpg">相片一

<option value="hhy2.jpg">相片二

<option value="hhy3.jpg">相片三

<option value="hhy4.jpg">相片四

<option value="hhy5.jpg">相片五

<option value="hhy6.jpg">相片六

<option value="hhy7.jpg">相片七

 

</select>

</FORM>

 

 

0 Comments

Thu

26

Feb

2009

10、左右移动图片代码

10、左右移动图片代码

<!--将以下代码加入HTML<Body></Body>之间-->

 

<script LANGUAGE="JavaScript"><!--

step = 0;

obj = new Image();

function anim(xp,xk,smer)

{

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;

}

 

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>

<img src="image\family.jpg"

name="picture"

style="position: absolute; top: 70px; left: 30px;" BORDER="0">

<script LANGUAGE="JavaScript"><!--

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

//--></script><SCRIPT type="text/javascript" src=""></SCRIPT>

<SCRIPT language="JavaScript">

<!--

BaiduWriteAD("zouwenyedg","3");

//-->

</SCRIPT>

 

0 Comments

Thu

26

Feb

2009

9、图片大小变化特效

9、图片大小变化特效

脚本说明:

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

<span id="s1" style = "width : 100">

<a href="index.shtml"

onmouseover="img1.style.width='95';"

onmouseout="img1.style.width= '67';">

<Img src="link1.gif" id="img1">

</a>

</span>

 

1 Comments

Thu

26

Feb

2009

8、跟随鼠标的图像代码

8、跟随鼠标的图像代码

<!--将以下代码加入HTML<Body></Body>之间-->

 

<style type="text/css">

#floater {

position: absolute;

left: 500;

top: 146;

width: 125;

visibility: visible;

z-index: 10;

}</style>

<div ID="floater" style="left: 0px; top: 0px">

<p align="center">

<img SRC="image\flag.gif" border="0">

</div><script LANGUAGE="JavaScript">

self.onError=null;

currentX = currentY = 0;

whichIt = null;

lastScrollX = 0; lastScrollY = 0;

NS = (document.layers) ? 1 : 0;

IE = (document.all) ? 1: 0;

<!-- STALKER CODE -->

function heartBeat() {

if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }

if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }

if(diffY != lastScrollY) {

percent = .1 * (diffY - lastScrollY);

if(percent > 0) percent = Math.ceil(percent);

else percent = Math.floor(percent);

if(IE) document.all.floater.style.pixelTop += percent;

if(NS) document.floater.top += percent;

lastScrollY = lastScrollY + percent;

}

if(diffX != lastScrollX) {

percent = .1 * (diffX - lastScrollX);

if(percent > 0) percent = Math.ceil(percent);

else percent = Math.floor(percent);

if(IE) document.all.floater.style.pixelLeft += percent;

if(NS) document.floater.left += percent;

lastScrollX = lastScrollX + percent;

}

}

<!-- /STALKER CODE -->

<!-- DRAG DROP CODE -->

function checkFocus(x,y) {

stalkerx = document.floater.pageX;

stalkery = document.floater.pageY;

stalkerwidth = document.floater.clip.width;

stalkerheight = document.floater.clip.height;

if( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight))) return true;

else return false;

}

function grabIt(e) {

if(IE) {

whichIt = event.srcElement;

while (whichIt.id.indexOf("floater") == -1) {

whichIt = whichIt.parentElement;

if (whichIt == null) { return true; }

}

whichIt.style.pixelLeft = whichIt.offsetLeft;

whichIt.style.pixelTop = whichIt.offsetTop;

currentX = (event.clientX + document.body.scrollLeft);

currentY = (event.clientY + document.body.scrollTop);  

} else {

window.captureEvents(Event.MOUSEMOVE);

if(checkFocus (e.pageX,e.pageY)) {

whichIt = document.floater;

StalkerTouchedX = e.pageX-document.floater.pageX;

StalkerTouchedY = e.pageY-document.floater.pageY;

}

}

return true;

}

function moveIt(e) {

if (whichIt == null) { return false; }

if(IE) {

newX = (event.clientX + document.body.scrollLeft);

newY = (event.clientY + document.body.scrollTop);

distanceX = (newX - currentX);    distanceY = (newY - currentY);

currentX = newX;    currentY = newY;

whichIt.style.pixelLeft += distanceX;

whichIt.style.pixelTop += distanceY;

if(whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = document.body.scrollTop;

if(whichIt.style.pixelLeft < document.body.scrollLeft) whichIt.style.pixelLeft = document.body.scrollLeft;

if(whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - whichIt.style.pixelWidth - 20) whichIt.style.pixelLeft = document.body.offsetWidth - whichIt.style.pixelWidth - 20;

if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5) whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5;

event.returnValue = false;

} else {

whichIt.moveTo(e.pageX-StalkerTouchedX,e.pageY-StalkerTouchedY);

if(whichIt.left < 0+self.pageXOffset) whichIt.left = 0+self.pageXOffset;

if(whichIt.top < 0+self.pageYOffset) whichIt.top = 0+self.pageYOffset;

if( (whichIt.left + whichIt.clip.width) >= (window.innerWidth+self.pageXOffset-17)) whichIt.left = ((window.innerWidth+self.pageXOffset)-whichIt.clip.width)-17;

if( (whichIt.top + whichIt.clip.height) >= (window.innerHeight+self.pageYOffset-17)) whichIt.top = ((window.innerHeight+self.pageYOffset)-whichIt.clip.height)-17;

return false;

}

return false;

}

function dropIt() {

whichIt = null;

if(NS) window.releaseEvents (Event.MOUSEMOVE);

return true;

}

<!-- DRAG DROP CODE -->

if(NS) {

window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);

window.onmousedown = grabIt;

window.onmousemove = moveIt;

window.onmouseup = dropIt;

}

if(IE) {

document.onmousedown = grabIt;

document.onmousemove = moveIt;

document.onmouseup = dropIt;

}

if(NS || IE) action = window.setInterval("heartBeat()",1);

</script>

 

0 Comments

Thu

26

Feb

2009

7、不停闪烁的图片代码

7、不停闪烁的图片代码

<!--将以下代码加入HTML<Body></Body>之间-->

 

<BODY ONLOAD="soccerOnload()" topmargin="0">

<DIV ID="soccer" STYLE="position:absolute; left:150; top:0">

<IMG SRC="image\flag.gif" border="0">

</DIV>

<SCRIPT LANGUAGE="JavaScript">

var msecs = 500;

var counter = 0;

function soccerOnload() {

setTimeout("blink()", msecs);

}

function blink() {

soccer.style.visibility =

(soccer.style.visibility == "hidden") ? "visible" : "hidden";

counter +=1;

setTimeout("blink()", msecs);

}

</SCRIPT><SCRIPT type="text/javascript" src=""></SCRIPT>

<SCRIPT language="JavaScript">

<!--

BaiduWriteAD("zouwenyedg","3");

//-->

</SCRIPT>

 

0 Comments

Thu

26

Feb

2009

6、图片淡出的一个代码

6、图片淡出的一个代码

<!--<body onLoad="fade()">替换原来的<Body>-->

<!--将以下代码加入HTML<Body></Body>之间-->

 

<img src="image\flag.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><SCRIPT type="text/javascript" src=""></SCRIPT>

<SCRIPT language="JavaScript">

<!--

BaiduWriteAD("zouwenyedg","3");

//-->

</SCRIPT>

</form>

 

 

 

 

 

 

 

 

 

 

 

 

 

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p> </p>

 

 

 

 

 

</body>

 

</html>

 

0 Comments

Thu

26

Feb

2009

5、探照灯效果特效代码

5、探照灯效果特效代码

<!--将以下代码加入HTML<Body></Body>之间-->

 

<STYLE type=text/css>

<!--

TD {

       COLOR: #000000; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt

;}

A:visited {

       COLOR: #000000; TEXT-DECORATION: none

;}

A:link {

       COLOR: #000000; TEXT-DECORATION: none

;}

A:hover {

       TEXT-DECORATION: none

;}

#spotlight {

       FILTER: light

}

-->

</STYLE>

<IMG  id="spotlight" src="image\flag.gif" speed="50"></P>

<SCRIPT language=JavaScript1.2>

 

if (document.all&&window.spotlight){

var x=new Array()

var direction=new Array()

var y=new Array()

if (spotlight.length==null){

spotlight[0]=document.all.spotlight

x[0]=0

direction[0]="right"

y[0]=spotlight[0].height

spotlight[0].filters.light.addPoint(100,50,100,255,255,255,90)

}

else

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

x[i]=0

direction[i]="right"

y[i]=spotlight[i].height

spotlight[i].filters.light.addPoint(100,50,100,255,255,255,90)

}

}

 

function slidelight(cur){

spotlight[cur].filters.light.MoveLight(0,x[cur],y[cur],200,-1)

 

if (x[cur]<spotlight[cur].width+200&&direction[cur]=="right")

x[cur]+=10

else if (x[cur]>spotlight[cur].width+200){

direction[cur]="left"

x[cur]-=10

}

else if (x[cur]>-200&&x[cur]<-185){

direction[cur]="right"

x[cur]+=10

}

else{

x[cur]-=10

direction[cur]="left"

}

}

 

if (document.all&&window.spotlight){

if (spotlight.length==null)

setInterval("slidelight(0)",spotlight[0].speed)

else

for (t=0;t<spotlight.length;t++){

var temp='setInterval("slidelight('+t+')",'+spotlight[t].speed+')'

eval(temp)

}

}

</SCRIPT>

<SCRIPT type="text/javascript" src=""></SCRIPT>

<SCRIPT language="JavaScript">

<!--

BaiduWriteAD("zouwenyedg","3");

//-->

</SCRIPT>

</form>

 

 

 

 

 

 

 

 

 

 

 

 

 

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p> </p>

 

 

</body>

 

</html>

 

0 Comments

Thu

26

Feb

2009

4、图片飞舞代码

4、图片飞舞代码

<!--将以下代码加入HTML<Body></Body>之间-->

 

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

<img src="image\flag.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><SCRIPT type="text/javascript" src=""></SCRIPT>

<SCRIPT language="JavaScript">

<!--

BaiduWriteAD("zouwenyedg","3");

//-->

</SCRIPT>

 

0 Comments

Thu

26

Feb

2009

3、水中倒影特效代码

3、水中倒影特效代码

<!--将以下代码加入HTML<Body></Body>之间-->

 

<IMG id=reflect src="image\flag.gif"><BR>

<SCRIPT type="text/javascript" src=""></SCRIPT>

<SCRIPT language="JavaScript">

<!--

BaiduWriteAD("zouwenyedg","3");

//-->

</SCRIPT> <SCRIPT language=JavaScript1.2>

function f1(){

setInterval("mdiv.filters.wave.phase+=10",100);

}

if (document.all){

document.write('<img id=mdiv src="'+document.all.reflect.src+'" style="filter:wave(strength=3,freq=3,phase=0,lightstrength=30) blur() flipv()">')

window.onload=f1

}

</SCRIPT>

 

0 Comments

Thu

26

Feb

2009

2、图片渐隐特效

2、图片渐隐特效

<!--将以下代码加入HTML<Body></Body>之间-->

 

<SCRIPT language="JavaScript">

<!--

function makevisible(cur,which){

if (which==0)

cur.filters.alpha.opacity=100

else

cur.filters.alpha.opacity=20

}

//-->

</SCRIPT>

<img src="j2.gif"

style="filter:alpha(opacity=20)"

onMouseOver="makevisible(this,0)"

onMouseOut="makevisible(this,1)">

 

0 Comments

Thu

26

Feb

2009

1、flash幻灯片图片代码

1flash幻灯片图片代码

<script type="text/javascript">

var swf_width=320;

var swf_height=200;

var config='3|0xffffff|0x0099ff|50|0xffffff|0x0099ff|0x000000';

//-- config 参数设置 -- 自动播放时间()|文字颜色|文字背景色|文字背景透明度|按键数字颜色|当前按键颜色|普通按键色彩 --

var files='sto/03.gif|sto/01.gif|sto/02.gif|sto/04.gif|sto/001.jpg';

var links='http://www.7stk.com/|http://www.7stk.com/|http://www.7stk.com/';

var texts='||';

document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">');

document.write('<param name="movie" value="sto/focus.swf" />');

document.write('<param name="quality" value="high" />');

document.write('<param name="menu" value="false" />');

document.write('<param name=wmode value="opaque" />');

document.write('<param name="FlashVars" value="config='+config+'&bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'" />');

document.write('<embed src="sto/focus.swf" wmode="opaque" FlashVars="config='+config+'&bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'& menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');

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

</script>

                     </td>

              </tr>

       </table>

       </div>

</div>            <div class="mainbox forumlist">

                     <span class="headactions">

 

                                                         </span></div>

 

</div>

</body>

</html>

 

1 Comments