I’ve written this function and I would like to change the top and left values to variables so that the window will appear 100 px from the top right of the screen not the top left
so i just need to figure out how to detect the horizontal screen resolution and then position the window 100 px + the pop up window width away from that number
here’s the script i have so far
<!-- begin pop up window function -->
<SCRIPT LANGUAGE="Java-Script">
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=300, top=100, left=100, height=400');");
}
</script>
<!-- end pop up window function -->
That doesn’t make any sense to me. If you say left=100 then it will position it 100 from the left most position… You don’t have to detect resolutions because it does it automatically for you.
P.S. that script isn’t very good. You don’t need most of that code.
function popUp(url) {
window.open(url, 'newWin', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=300, top=100, left=100, height=400');
}