I have a web application that uses a lot of pop up windows.
One of my windows has a form with a text area and a link that opens a pop-up with items that they can click on to add to the text area. Actually, this particular form is quite long and has multiple text area/link combos.
The problem I’m experiencing is that when one of the links is clicked to open the pop up, the parent window is automatically scrolled back to the top of the page and away from the text area in question. This makes it difficult for the user to keep track of what they’re adding to the suddenly invisable text area.
Here’s the script that opens the window:
function newWindow3(target,w,h,anch) {
var myname = “diagWin”;
var winl = (screen.width – w)-15;
var wint = (screen.height – h)-80;
var winprops = ‘height=’+h+’,width=’+w+’,top=’+wint+’,left=’+winl+’,location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no’;
window.open(target, myname, winprops);
window.location.hash=anch;
}
Notice I added the “window.location.hash” command which works to momentarily bring up the anchor I want, but then it pops right back up to the top of the page.
Does anyone know a way to prevent the jump to top behavior?
Any suggestion would be appreciated. Thanks!