热门标签:   个人网站   个人网页   WAP网站   网页特效   网页教程   收藏本站   设为主页  
首 页   个人网站   个人博客   WAP网站   网页特效   网页教程   软件教程   我要参展
帐 号: 密 码:
 
网站及资源搜索:  
 
  当前位置 > 中国个人网页秀-> 网页特效-> 页面特效-> 图形图像-> 图像虚幻显示特效
图像虚幻显示特效
整理:Cnwshow.Com   来源:Internet   整理时间:2008-6-19

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>图像虚幻显示特效</title>
</head>

<body onload=setValues()>
<SCRIPT language=JavaScript>
<!-- Beginning of JavaScript -
var x,y
var marginbottom
var marginleft=0
var margintop=0
var marginright
var cliptop
var clipbottom
var clipleft
var clipright
var clippoints



var ballheight=150

var ballwidth=150



var imageheight=525

var imagewidth=457





// less is faster

var tempo=25



// horizontal move (pixels) within time unit

var stepx=12



// vertical move (pixels) within time unit

var stepy=6

var timer





// check the width and the height of the document

// gets the starting position of the ball by random

function setValues() {

if (document.all) {

     marginbottom = imageheight-ballheight

     marginright = imagewidth-ballwidth

document.all.ball.style.posLeft=randommaker(400)

    document.all.ball.style.posTop=0

document.all.textcontent.style.posLeft=0

    document.all.textcontent.style.posTop=0

document.all.ball.style.filter="alpha(opacity=0,finishopacity=100,style=2,startX=0px,startY=0px,finishX=100px,finishY=100px)"

     moveball()

}

}



// randomfunction

function randommaker(range) {

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

    return rand

}



function moveball() {

checkposition()

if (document.all) {

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

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



cliptop=document.all.ball.style.posTop

clipbottom=cliptop+ballheight

clipleft=document.all.ball.style.posLeft

clipright=clipleft+ballwidth



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

document.all.textcontent.style.clip=clippoints

     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

}

}

}

// - End of JavaScript - -->

</SCRIPT>

<span id=textcontent style="LEFT: -5000px; POSITION: absolute; TOP: -5000px"><IMG

border=0 src="204.jpg"> </span>

<span id=ball

style="BACKGROUND-COLOR: white; HEIGHT: 150px; POSITION: absolute; TOP: -50px; WIDTH: 150px"></span>
    
</body>
</html>

运行代码预览特效
  图形图像 热门点击
·图片翻页效果代码
·自由变化大小的图片
·给图片加注释
·向上下左右滚动图片的特效
·像篮球一样跳动的图片
·水中倒影
·自由浮动图像特效
·鼠标让图片震动
·图片渐渐显隐
·图片渐渐显示
  酷站推荐
关于本站  联系本站  免责声明  使用帮助  网站搜索  网站地图
Copyright © 2005-2008 Cnwshow.Com Inc All Rights Reserved 中国个人网页秀
技术支持:网秀科技   QQ群:36941957  客服QQ:151483161  粵ICP备05134415号