Click to See Complete Forum and Search --> : Popup window


Lotus
07-09-2003, 01:41 PM
<a href="webradio.html" onMouseOut="RestoreImg()" onMouseOver="SwitchImg('document.webradiobtn','document.webradiobtn','webradio2.jpg')"><img src="webradio.jpg" name="webradiobtn" width="150" height="25" alt="Åpne ekstern webradio" border="0"></a>

This is the code I have in my webpage. Notice href="webradio.html". This is the thing I wanna change. I still want it to be exactly the same link with the same cursor and everything, but I want that document to pop up in a new window. How do I code this into the current rollover image?

David Harrison
07-09-2003, 01:50 PM
Try this:

<a href="# onMouseOut="RestoreImg()" onMouseOver="SwitchImg('document.webradiobtn','document.webradiobtn','webradio2.jpg')" onclick="('webradio.html','','');return false;"><img src="webradio.jpg" name="webradiobtn" width="150" height="25" alt="Åpne ekstern webradio" border="0"></a>

Charles
07-09-2003, 02:05 PM
Originally posted by lavalamp
Try this:

<a href="# onMouseOut="RestoreImg()" onMouseOver="SwitchImg('document.webradiobtn','document.webradiobtn','webradio2.jpg')" onclick="('webradio.html','','');return false;"><img src="webradio.jpg" name="webradiobtn" width="150" height="25" alt="Åpne ekstern webradio" border="0"></a> That'll leave you with a broken link for the 13% of users who do not use JavaScript. Use instead:

<a href="webradio.html" onmouseiout="RestoreImg()" onmouseover="SwitchImg('document.webradiobtn','document.webradiobtn','webradio2.jpg')"><img src="webradio.jpg" name="webradiobtn" width="150" height="25" alt="Åpne ekstern webradio" border="0" onclick="window.open(this.href); return false"></a>

Lotus
07-09-2003, 02:09 PM
That didn't work, now webradio.html won't load at all.

EDIT: Instead, the rollover IMAGE pops up in a new window (lol), and on top of that the rollover image freezes on the main page so wether you hav the mouse over the "webradio" button or not it still displays the rollover image...

Check home.no.net/xmedia for the actual page, so you can get a more clear vision of the problem.

Lotus
07-09-2003, 02:32 PM
No, hey, I found out! Haha! I just put the script that actually opens the window and the player inside the <head> tags, and added

javascript:openPlayer('minradio.no', 'radio1bergen', '22');

where the page to open should be. I had ofcourse copied the source of the page to my own, but as the radio relies on external information, it was clear enogh that it didn't work...

Thx for your activity folx anyway!

David Harrison
07-09-2003, 03:24 PM
Well spotted about the broken link, so I figure if you're going to use:
a href="webradio.html"

it may also be better to include:
target="_new"

in the a tag so as to give the same effect for the ppl without js.

Edit: I just realised on the school bus this morning that target="_new" should actually be target="_blank", just so you know.