<html>
<head>
<title>飘荡的图片</title>
</head>
<body>
<script language="javascript">
<!--
function a(){
for(var i=1;i<1;i++){
if((i/2)%!=0){
document.write("<marquee behavior='alternate' scrollamount=3 scrolldelay=1 direction='right'>
<img src='5.jpg'>
</marquee>");
}
if((i/2)%==0){
document.write("<marquee behavior='alternate' scrollamount=3 scrolldelay=1 direction='down'>
<img src='5.jpg'>
</marquee>");
}
}
-->
</script>
</body>
</html>
为什么什么也没有,我错在哪里了??
<head>
<title>飘荡的图片</title>
</head>
<body>
<script language="javascript">
<!--
function a(){
for(var i=1;i<1;i++){
if((i/2)%!=0){
document.write("<marquee behavior='alternate' scrollamount=3 scrolldelay=1 direction='right'>
<img src='5.jpg'>
</marquee>");
}
if((i/2)%==0){
document.write("<marquee behavior='alternate' scrollamount=3 scrolldelay=1 direction='down'>
<img src='5.jpg'>
</marquee>");
}
}
-->
</script>
</body>
</html>
为什么什么也没有,我错在哪里了??
再者 你的for循环也进不去啊 for(var i=1;i<1;i++) 这第一次就不符合判断条件
不过现在基本没有浏览器不支持js,基本是可以去掉的,但是加上是没有错的