If users are not authenticated and click something only authenticated users do then i am loading a modal dialog saying they need to login to perform this.
the modal contains a link which when clicked is meant to load a modal dialog with a login form.
this is what i have:
$("#login-link").click(function () {
$("#dialog-unauthenticated").dialog("close");
var x = $(this).position().left + jQuery(this).outerWidth();
var y = $(this).position().top - jQuery(document).scrollTop();
$("#dialog-form").dialog("open",{position:[x,y]});
});
it works okay, the only problem is that the page does not maintain the scroll position. the dialog loads in the right place.
how can i maintaining page scroll position instead of it scrolling to the top?