View Full Version : new window


cmvpjones
04-19-2006, 12:47 AM
How can i get the open in new window code in with the mouseover code.

<a href="http://www.psu.edu/" onMouseOver="parent.location='http://www.psu.edu/'">PSU Homepage</a>


and target="_blank"


Thanks

Douglas
04-19-2006, 01:26 AM
<a href="http://www.psu.edu/" onmouseover="javascript:window.open='this.href'">PSU Homepage</a>

That should work ;)

cmvpjones
04-19-2006, 03:30 PM
I tried this and it didn't work


<a href="http://www.psu.edu/" onMouseOver="javascript:window.open='http://www.psu.edu/'">PSU Homepage</a>


i'm not sure what's wrong with it

Thanks

kiwee
04-19-2006, 07:44 PM
just leave it as Douglas gave it to you as:

<a href="http://www.psu.edu/" onmouseover="javascript:window.open='this.href'">PSU Homepage</a>

the href="" attribute tells it where to go, the onmouseover="" should be left as it is.

cmvpjones
04-20-2006, 01:06 AM
i'm really sorry to be such a pain....i've tried it both ways.

1) i copied what douglas did but that didn't work

<a href="http://www.psu.edu/" onmouseover="javascript:window.open='this.href'">P SU Homepage</a>

2) i changed 'this.ref' to http://www.psu.edu/

I don't know what's wrong with it.....i've tried viewing it in both IE and Firefox

does it work for anyone else?

thank you so much for your help

Douglas
04-20-2006, 01:15 AM
Try this, it worked for me, just turn your popup blocker off:


<script language="JavaScript" type="text/javascript">
<!--;
function open_window() {
var url = "http://www.psu.edu/";
window.open(url,"","");
}
//-->
</script>
<a href="http://www.psu.edu" onmouseover="javascript:open_window();">PSU Homepage</a>

cmvpjones
04-29-2006, 08:36 PM
I copied the code exactly how you had it and turned off my popup blocker and it still didn't work for me.

I've tried this code and it works but it opens multiple browsers at the same time


<html>
<body>

<a href="http://www.google.com/"
onMouseOver="window.open(this.href,'','width=1200,height=1000,t oolbar=yes,location=yes,directories=yes,status=yes ,menubar=yes,scrollbars=yes,copyhistory=yes,resiza ble=yes');">Click here</a>


</body>
</html>



Thanks

ben

war59312
04-30-2006, 03:02 AM
Hey,

Look, opening a new window on mouse over is considered dumb and bad pratice.

Likly, 99% of your users will find it very annorying and will never revist your site ever again.

Or the 99% will never ever see the new window because of their popup blocker.

So either way your users luck out!

Onmouseover should only be used for menus.

So just use this:<html>

<head>

<title>Open Window Test</title>

<script language="JavaScript" type="text/javascript">

function psu_homepage() {

var url = "http://www.psu.edu/"; window.zyXZ(url,"","width=1200, height=1000,toolbar=yes,location=yes,directories=y es,status=yes,menubar=yes,scrollbars=yes,copyhisto ry=yes,resizable=yes");

}

</script>

</head>

<body>

<a href="javascript: psu_homepage();">PSU Homepage</a>

</body>

</html>Enjoy,

Will