当前位置: 代码迷 >> ASP >> 关于IFRAME图片替代滚动条的有关问题
  详细解决方案

关于IFRAME图片替代滚动条的有关问题

热度:145   发布时间:2012-02-21 16:26:23.0
关于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>
  相关解决方案