jQWidgets Forums

jQuery UI Widgets Forums DataTable Scroll position

This topic contains 2 replies, has 2 voices, and was last updated by  carlo 11 years, 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Scroll position #49161

    carlo
    Participant

    Hi Peter,

    after calling $(‘#datatable’).hide() and $(‘#datatable’).show() the page is scrolled to the top. I want to scroll the page to the same position as before the hide(). Can you give some tipp how this can be done ?

    Best Regards
    Carlo

    Scroll position #49163

    Peter Stoev
    Keymaster

    Hi Carlo,

    When you show/hide DIV elements, the height of your page is changed. To perform scrolling, you may use jQuery: http://api.jquery.com/scroll/

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    Scroll position #49180

    carlo
    Participant

    Hi Peter,

    thank you very much. Thats how I have done it.
    Before hiding get the scoll position: scrollPosition = $(window).scrollTop();
    After showing again scroll to the same postion: $(‘html, body’).animate({scrollTop: scrollPosition}, 0);

    Best Regards
    Carlo

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.