Jquery-ui Dialog scrolling to the bottom of the page when clicked

I have an asp.net page with enough material that opens another page in the jquery iframe dialog. the dialog opens as follows

<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; } 

everything works fine, different from when the link is clicked, the "parent" page jumps around the height of the screens , and you have to scroll back to the dialog - this is in IE 8 and 9 - in FF

using jquery: 1.8.0 ui: 1.8.23

any ideas? thanks

+4
source share
1 answer

finished editing jquery-ui css and changed the position from absolute 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; } 
+5
source

Source: https://habr.com/ru/post/1432671/


All Articles