Click to See Complete Forum and Search --> : page jusmps up when i open a pop up


popcop
07-06-2004, 09:52 AM
im using this code for a popups...


<script language="JavaScript">
<!--

function open_read(inUrl)
{
winLeft = (screen.availWidth-320)/2;
winTop = (screen.availHeight-400)/2;

if (navigator.appName == "Microsoft Internet Explorer") {
strWindow = "toolbar=no,location=no,status=no,directories=no,menubar=no,scrollbars=yes,resizable=no,width=320,hei ght=400,left="+winLeft+",top="+winTop
} else {
strWindow = "toolbar=no,location=no,status=no,directories=no,menubar=no,scrollbars=yes,resizable=no,width=320,hei ght=400,screenX="+winLeft+",screenY="+winTop
}

window.open(inUrl, "read", strWindow);

}

//-->

</script>


when i click on the link and the pop up opens the page jumps up...

you can see what i mean here... www.m8magazine.com/newsite

just click the top link in the news

Pittimann
07-06-2004, 09:55 AM
Hi!

Example:

<a href='#' onClick='open_read("read.php?id=12");return false;'><img src='images/readmore.jpg' width='63' height='13' border='0'></a>

Cheers - Pit

David Harrison
07-06-2004, 10:27 AM
A better way to make the link would be this:<a href="page.html" onclick="open_read(this.href);return false;">This method will allow the link to work in non-JavaScript browsers and allow users to right click and open in new tab/window should they want to.