日期:2014-05-17  浏览次数:20886 次

关于IFRAME图片替代滚动条的问题
<iframe   id= "frm "   width= "410 "   height= "235 "   scrolling= "no "   src= "news.html "   frameborder= "0 "> </iframe>

                <img   src= "images/dot1.gif "   style= "img "   width= "15px "   height= "15px "onMouseOver= "sf=setInterval( 'frm.scrollBy(0,-2) ',1) "   onMouseOut= "clearInterval(sf) "   >
                <br/> <img   src= "images/dot3.gif "   style= "img "   width= "1px "   height= "165px "   />
                <br/> </br> <img   src= "images/dot2.gif "   style= "img "   width= "15px "   height= "15px "   onMouseOver= "sf=setInterval( 'frm.scrollBy(0,2) ',1) "   onMouseOut= "clearInterval(sf) "   >
            </div>
没法用啊...这段代码....

------解决方案--------------------
代码错误。下面是可以的

<iframe id= "frm " width= "410 " height= "235 " scrolling= "no " src= "b.htm " frameborder= "0 "> </iframe>
<img src= "images/dot1.gif " style= "img " width= "15px " height= "15px "onMouseOver= "s(false) " onMouseOut= "clearInterval(sf) " >
<br/> <img src= "images/dot3.gif " style= "img " width= "1px " height= "165px " />
<br/> <br/> j <img src= "images/dot2.gif " style= "img " width= "15px " height= "15px " onMouseOver= "s(true) " onMouseOut= "clearInterval(sf) " >
</div>
<script>
var sf
function s(b)
{
if(b)
sf=setInterval( 'window.frames[ "frm "].scrollBy(0,2) ',1)
else
sf=setInterval( 'window.frames[ "frm "].scrollBy(0,-2) ',1)
}
</script>