The problem is when Im scrolling down my page (e.g Yposition = 1500) and reloading my dialogPreview. The srollTop position of the page is changing to the top of the page (there is located dialog).
var yPos = document.documentElement.scrollTop || document.body.scrollTop;
$("#dialogPreview").dialog({
title : $("#previewTitle").val(),
resizable : false,
width : 185,
height : 240,
draggable : false,
dialogClass : "dialogPreviewClass",
position : {
my : "left top",
at : "left bottom",
of : $("#previewHandler")
},
open: function( event, ui )
{
document.documentElement.scrollTop = yPos;
alert("test");
},
close : onCloseDialog,
autoOpen : false
});
"open" function is running too fast. How to check if dialog is loaded and change scrollTop position in right moment and place? jquery version 1.10. On 1.9 everything was right.