jQuery Dialog scroll to element in dialog

前端 未结 1 1407
我在风中等你
我在风中等你 2021-01-12 17:32

I have the following issue:

I open a dialog box with jQuery UI. This dialog box contains a lot of content, which can\'t be displayed at once.

Is it possible

1条回答
  •  甜味超标
    2021-01-12 18:26

    Possible duplicate

    Answer from previous question:

    var container = $('div'),
    scrollTo = $('#row_8');
    
    container.scrollTop(
        scrollTo.offset().top - container.offset().top + container.scrollTop()
    );
    
    // Or you can animate the scrolling:
    container.animate({
        scrollTop: scrollTo.offset().top - container.offset().top + container.scrollTop()
    });​
    

    0 讨论(0)
提交回复
热议问题