与这个同理
left.htm
left<br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br>
<script language="javascript">
function doScroll()
{
/*  parent.frames["right"].document.body.scrollTop = document.body.scrollTop;
//此为两帧同长度滚动
*/
  parent.frames["right"].document.body.scrollTop = (document.body.scrollTop*parent.frames["right"].document.body.scrollHeight)/document.body.scrollHeight;
//此为两帧同速度滚动,但左右帧不能同时调用此函数,否则溢出错
}window.onscroll = doScroll;
</script>right.htm
right<br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br>
<script language="javascript">
function doScroll()
{
/*  parent.frames["left"].document.body.scrollTop = document.body.scrollTop;
//此为两帧同长度滚动
*/
  parent.frames["left"].document.body.scrollTop = (document.body.scrollTop*parent.frames["left"].document.body.scrollHeight)/document.body.scrollHeight;
//此为两帧同速度滚动,但左右帧不能同时调用此函数,否则溢出错
}window.onscroll = doScroll;
</script>main.htm
<frameset name=framesetname cols="300,*">
<frame name="left" src="left.htm">
<frame name="right" src="right.htm">
</frameset>

解决方案 »

  1.   

    http://www.blueidea.com/bbs/newsdetail.asp?id=423829
      

  2.   

    sorry,网络一直不通,短信早收到,现在贴上来,看看行不行top.htm
    top<p>tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
    <script language="javascript">
    function doScroll()
    {
      parent.frames["mybottom"].document.body.scrollWidth = document.body.scrollWidth;
    //此为两帧同长度滚动//  parent.frames["mybottom"].document.body.scrollWidth = (document.body.scrollWidth*parent.frames["mybottom"].document.body.scrollWidth)/document.body.scrollWidth;
    //此为两帧同速度滚动,但两帧不能同时调用此函数,否则溢出错
    }
    window.onscroll = doScroll;
    </script>bottom.htm
    bottom<p>bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
    <script language="javascript">
    function doScroll()
    {
      parent.frames["mytop"].document.body.scrollWidth = document.body.scrollWidth;
    //此为两帧同长度滚动//  parent.frames["mytop"].document.body.scrollWidth = (document.body.scrollWidth*parent.frames["mytop"].document.body.scrollWidth)/document.body.scrollWidth;
    //此为两帧同速度滚动,但两帧不能同时调用此函数,否则溢出错
    }
    window.onscroll = doScroll;
    </script>main.htm
    <frameset name=framesetname rows="300,*">
    <frame name="mytop" src="top.htm">
    <frame name="mybottom" src="bottom.htm">
    </frameset>
      

  3.   

    <frameset name=framesetname rows="300,*">
    <frame name="mytop" src="top.htm">
    <frame name="mybottom" src="bottom.htm">
    </frameset>mytop.document.body.onscroll = Function("mytop.document.body.scrollLeft = mybottom.document.body.scrollLeft");好象是这么写的吧
      

  4.   

    runmin(悠悠 稻草人):谢谢你的指正!!不好意思,我昨天下午就上不去了,后来一气之下跑到网吧去,临时重写,居然犯晕,写错了
    修改如下
    top.htm
    top
    <p>ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
    <script language="javascript">
    function doScroll()
    {
      parent.frames["mybottom"].document.body.scrollLeft = document.body.scrollLeft;/*  parent.frames["mybottom"].document.body.scrollLeft = (document.body.scrollLeft*parent.frames["mybottom"].document.body.scrollWidth)/document.body.scrollWidth;
    */
    }
    window.onscroll = doScroll;
    </script>bottom.htm
    bottom
    <p>bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
    <script language="javascript">
    function doScroll()
    {
      parent.frames["mytop"].document.body.scrollLeft = document.body.scrollLeft;
    //此为两帧同长度滚动/*  parent.frames["mytop"].document.body.scrollLeft = (document.body.scrollLeft*parent.frames["mytop"].document.body.scrollWidth)/document.body.scrollWidth;
    //此为两帧同速度滚动,但两帧不能同时调用此函数,否则溢出错
    */
    }
    window.onscroll = doScroll;
    </script>
      

  5.   

    Andrawu:哎呀,我都不知自己是怎么了,上不了的时候就觉得特烦,尤其是有问题没有答完的情况,就觉得哪怕跑去网吧也要把问题结了。csdn真的有种魔力吗??
      

  6.   

    To seabell(百合心):
         人做任何事情,都有背后的动机或者某种激励。所谓有果必有因。刚刚看了《人人都能成功》说共有10种:
    1.自我保护的愿望
    2.爱的情绪
    3.恐惧的情绪
    4.性的情绪
    5.死后生活的愿望
    6.谋求身心自由的愿望
    7.愤怒的情绪
    8.憎恨的情绪
    9.谋求认识和自我表现的愿望
    10.获取物质财富的愿望假设上述翻译过来的没有错误的话,似乎动机是第二个和第九个。你有着关心和照顾革命同志的爱心,想来CSDN一定有你喜欢的事物或人;同时,你也希望自己的才华展现出来被人发现,被人欣赏。这个解释你觉得如何?另外有几句话要说:你的确很优秀,我很欣赏你:)
      

  7.   

    weidegong:希尔的《人人都能成功》大一就读过,只惜印象已经不深了,所以也就没有成功啊一语中的 
    :)