问问论坛里面的各位有没有会的或收藏这样的特效 就是背景图片会左右晃动,有点电影的感觉,请问是flash做的还是js写出来的,如果碰巧有会的或者收藏的能不能晒一下~~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 通过js控制background-position样式吗? <html> <head> <title></title> <style> .bg1 { width:300px; height:300px; background-image:url('a.jpg'); background-position-x:-100px; background-position-y:0px; } .bg2 { width:300px; height:300px; background-image:url('a.jpg'); background-position-x:-140px; background-position-y:0px; } </style> <script> var index = 0; function f_onload(){ var vv = setInterval("next()",100); } function next(){ index ++; if(index % 2 == 0){ document.getElementById("bg").className = "bg1"; }else{ document.getElementById("bg").className = "bg2"; } } </script> </head> <body onload="f_onload();"> <div id="bg" class="bg1"> </div> </body></html>楼主,试试吧,看看能不能达到你要的效果 很奇怪的问题,ext4单击或选择复选框,为何触发事件无效? image标签的问题 关于在网页中处理frame事件的问题,高手来啊,很有挑战性!!!! 请问JS变量如何通过FORM传参(急) VBScript好....还是....JAVAScript好 消息框的问题?急 这个问题,真是送分的,马上兑现! 关于定时器 如何能让IE窗口隐藏最顶端的蓝色横条? 注册表问题,加急!!!!!!!~~ 菜鸟求助 Jquery 如何获取Lable里面的值?
<html>
<head>
<title></title>
<style>
.bg1 {
width:300px;
height:300px;
background-image:url('a.jpg');
background-position-x:-100px;
background-position-y:0px;
}
.bg2 {
width:300px;
height:300px;
background-image:url('a.jpg');
background-position-x:-140px;
background-position-y:0px;
}
</style>
<script>
var index = 0;
function f_onload(){
var vv = setInterval("next()",100);
}
function next(){
index ++;
if(index % 2 == 0){
document.getElementById("bg").className = "bg1";
}else{
document.getElementById("bg").className = "bg2";
}
}
</script>
</head>
<body onload="f_onload();">
<div id="bg" class="bg1">
</div>
</body>
</html>
楼主,试试吧,看看能不能达到你要的效果