window.setInterval(
function(){
if((document.body.scrollTop+document.body.offsetHeight) < document.body.scrollHeight)
window.scroll(document.body.scrollLeft,document.body.scrollTop+5);
else
window.scroll(0,0);
window.status = document.body.scrollTop + "-->" + document.body.scrollHeight;
},
200
);XX他大丫地,我是来抢分的,刚写了半天,那个帖子里也要抢...
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" align="left" id="frmTitle" nowrap="true" style="padding-left:20">
<xsl:element name="iframe">
<xsl:attribute name="name">frm_tm</xsl:attribute>
<xsl:attribute name="width">98%</xsl:attribute>
<xsl:attribute name="height">500</xsl:attribute>
<xsl:attribute name="id">frm_tm</xsl:attribute>
<xsl:attribute name="frameborder">0</xsl:attribute>
<xsl:attribute name="scrolling">no</xsl:attribute>
<xsl:attribute name="src"><xsl:value-of select='/DIPS_TEST_SHOW/@WEB_SIGN'/>yxk/Englis 900/001.htm</xsl:attribute>
</xsl:element>
<script language="javascript">
function scrollwindow()
{
scrollx = frm_tm.document.body.scrollLeft;
scrolly = frm_tm.document.body.scrollTop;
scrolly += 1;
frm_tm.window.scroll(scrollx,scrolly);
}
setInterval(scrollwindow,60);
</script>
</td>
</tr>
</table>src中插的是HTML,路径是活的。目前我是写的固定的。关键是scrollwindow中如何写能实现让scrolly的值变为0后重新在往下滚动。
麻烦高手看一下。谢谢。
function scrollwindow()
{
scrollx = frm_tm.document.body.scrollLeft;
scrolly = frm_tm.document.body.scrollTop;
scrollh = frm_tm.document.body.scrollHeight
if(scrolly < scrollh )
{
scrolly += 1;
frm_tm.window.scroll(scrollx,scrolly);
}
else
{
frm_tm.window.scroll(0,0);
frm_tm.window.status = frm_tm.document.body.scrollTop ;
}
}
setInterval(scrollwindow,60);
</script>
麻烦你看一下,哪不对