Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery-ui Dialog scrolling to bottom of page on click

I have a asp.net page with a fair amount of stuff on it, that opens another page in jquery dialog iframe. the dialog is opened by the following

<a onclick="OpenDialog(params);return false;">click to open dialog<a/>

function OpenDialog(params){
    var url ='Detail.aspx?params;
    $('#frmDialog').attr('src', url);
    $( "#dialog-modal" ).dialog({
        height: 500,
        width: 950,
        title: 'Details',
        modal: true,
        close: function(a,b){refreshPage();}
    });
    return false;
}

all is working perfectly fine other than when the link is clicked, the 'parent' page jumps down around a screens height, and you then have to scroll back up to the dialog - this is in IE 8 & 9 - seems to be fine in FF

using jquery :1.8.0 ui: 1.8.23

any ideas? thanks

like image 415
nat Avatar asked Oct 07 '22 17:10

nat


1 Answers

ended up with editing the jquery-ui css and changing the absolute positioning to fixed.. serves my purpose.

.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }

to

.ui-dialog { position: fixed; padding: .2em; width: 300px; overflow: hidden; }
like image 173
nat Avatar answered Oct 10 '22 10:10

nat