Synchronize 2 frames

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gerard Jonker

    Synchronize 2 frames

    Hello

    I am trying to synchronize 2 frames with code as shown below but it
    only works in IE5.2 for the Mac, in Safari or in IE6 for Windows it
    does not work.
    Is there a solution for this?

    Gerard Jonker
    The Netherlands



    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
    "http://www.w3.org/TR/html4/frameset.dtd">
    <HTML>
    <HEAD>
    <TITLE>
    frame scrolling synchronization
    </TITLE>
    <SCRIPT>
    var tid;
    function initScrollSynch ronization () {
    tid = setInterval('sy ncFrame()', 25);
    }
    function syncFrame () {
    if (document.all && !window.opera) {
    var scrollTop = frame0.document .body.scrollTop ;
    var scrollLeft = frame0.document .body.scrollLef t;
    }
    else {
    var scrollTop = frame0.pageYOff set;
    var scrollLeft = frame0.pageXOff set;
    }
    frame1.scrollTo (scrollLeft, scrollTop);
    }
    </SCRIPT>
    </HEAD>
    <FRAMESET COLS="50%, 50%" ONLOAD="initScr ollSynchronizat ion()">
    <FRAME NAME="frame0" SRC="file1.html ">
    <FRAME NAME="frame1" SRC="file2.html ">
    </FRAMESET>
    </HTML>

    --
Working...