-1

I have a jquery dialog that has a fixed height (which is what i want so please don't response to use height: 'auto') but I want to see if there is anyway using jquery to programtically scroll the dialog as I am showing errors at the bottom of the dialog and want to make sure the users sees it.

Is this possible to programmatically scroll the window INSIDE a jquery ui dialog to the bottom?

leora
  • 188,729
  • 360
  • 878
  • 1,366

1 Answers1

1

Here is a function:

function ScrollTo(id){

      // Scroll
    $('divDialog').animate({
        scrollTop: $("#"+id).offset().top},
        'slow');
}

Just pass it the element id and it will scroll to there.

Like this:

ScrollTo("div1");
Ehsan Sajjad
  • 61,834
  • 16
  • 105
  • 160