How to get jQueryui dialog scrollTop to scroll dialog content to top
Try
$("#the_dialog_div").scrollTop("0")
This worked for me!
this is working for me
$(function()
{
$( "#tos_dialog" ).dialog({
title: 'Terms Of Service Agreement',
autoOpen: true,
height: 480,
width: 640,
modal: true,
show: "blind",
hide: "explode",
buttons: {
"I Accept": function() {
$( this ).dialog( "destroy" );
$( "#login_container" ).dialog( "destroy" );
window.location.replace('/main.php');
},
"I Decline": function() {
$( this ).dialog( "destroy" );
}
},
open: function() {
//Solution HERE
$( ".ui-dialog-content" ).scrollTop(0);
//End of Solution
}
});
Try:
setTimeout(function(){
$('#selector').scrollTop("0");
},100);