Link to home
Start Free TrialLog in
Avatar of azyet24
azyet24Flag for United States of America

asked on

Javascript new window using an image as hyperlink

I need to have an image act as a hyperlink and when the user clicks on it, I need a new window to open that I can specify the size and location of the window.  I've tried this but it doesn't work:

<span class="popup" onClick=javascript:window.open("player.aspx?id=49",blank","toolbar=no,width=320,height=290,top=0,left=0")><img src="images/KPC/kidsfest_04.jpg"></span>

Please help!
Bobby
ASKER CERTIFIED SOLUTION
Avatar of BogoJoker
BogoJoker

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 0h4crying0utloud
0h4crying0utloud


try this:

      <span class="popup" onClick=javascript:window.open("player.aspx?id=49","","toolbar=no,width=320,height=290,top=0,left=0")><img src="images/KPC/kidsfest_04.jpg"></span>
Avatar of azyet24

ASKER

Ok, I can see that this will be confusing.  How can I make this look and act like a hyperlink (hand appears on rollover)?
<img style="cursor: pointer;" src="...">

Joe P
That same style code can be put in the <span> if you don't want it in the <img>
<span class="popup" onClick="..." style="cursor: pointer;"><img src="..."></span>

Joe P
Avatar of azyet24

ASKER

Ok BogoJoker, that worked.  Thanks.