Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
245
get scroll position in
posted

hi,

i am using webdialog window in my application. when window is scroll i need to get how much user has scrolled the window using javascript.

i tried below code it retuns 0 always.

var objpopup = document.getElementById("Dialogwindowid");
var test = objpopup.scrollTop;

Could anyone suggest me how can we acheve this.

Regards,
M.Seenuvasan

Parents
No Data
Reply
  • 24497
    Suggested Answer
    posted

    Hi Seenuvasan,

    I wrote a sample for you to check instant scroll.

    <script type="text/javascript">
    function getScroll()
    {
     var dialog = $find('<%=WebDialogWindow1.ClientID%>');
     if(dialog)
      alert('scroll:' + dialog.get_contentPane().getBody().scrollLeft + ':' + +dialog.get_contentPane().getBody().scrollTop);
    }
    </script>
    <ig:WebDialogWindow ID="WebDialogWindow1" runat="server" Height="200px" Width="200px">
     <ContentPane>
      <Template>
       <div style="width:500px;height:500px;border:1px solid red;"></div>
      </Template>
     </ContentPane>
    </ig:WebDialogWindow>
    <input type='button' value='get scroll' onclick='getScroll()' />

Children
No Data