Atalasoft
Welcome to Atalasoft Community Sign in | Join | Help

Re: Sync Scrolling

  •  27 Sep 2007, 4:04 PM

    Re: Sync Scrolling

    As long as both of your viewers are the same size, the images that they contain are the same size, and both controls are at the same zoom level, the code below will work:

    <cc1:WebImageViewer ID="WebImageViewer1" runat="server" Height="400px" Width="300px" />
    <cc1:WebImageViewer ID="WebImageViewer2" runat="server" Height="400px" Width="300px" />
       
    <script language="javascript" type="text/javascript">
       atalaInitClientScript('OnPageLoad();');
       function OnPageLoad(){
          WebImageViewer1.ScrollPositionChanged = Viewer1Changed;
          WebImageViewer2.ScrollPositionChanged = Viewer2Changed;
       }
      
       function Viewer1Changed(){
          WebImageViewer2.setScrollPosition(WebImageViewer1.getScrollPosition());
       }

       function Viewer2Changed(){
          WebImageViewer1.setScrollPosition(WebImageViewer2.getScrollPosition());
       }
    </script>


    David Cilley
    My AJAX Imaging Blog
    Atalasoft Development Team
    Filed under: ,
View Complete Thread