How to disable/workaround autoscrolling to the end of page on popup/div adding

I've written this code for popup creation:\[code\]function showPopup(titleString, contentHtml, widthInt, heightInt) {var popupID = 'dialog-modal';if ($("#" + popupID).length == 0) { jQuery(document.body).append('<div id="' + popupID + '"/>');}var popup = $("#" + popupID);popup.html('<div id="' + popupID + '" style="width:100%; height:100%;">' + contentHtml + '</div>');popup.dialog({ width : widthInt, height : heightInt, title : titleString, modal : true});\[/code\]}And this code is called on button click...The matter is - when I click the button, at first time, page is scrolled to the end, and popup is shown there. It doesn't happen, on the second, etc times. (I mean, in 2,3... times, popup is shown in the middle of the current page position)And seems, this is specific for chrome, because it doesn't happen in FF, or IE.So, quetions are - why does it happen? and how to get rid of it?(I'm writing on JS/html only the third day :) may be I've missed smth)
 
Back
Top