azyet24
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("play er.aspx?id =49",blank ","toolbar =no,width= 320,height =290,top=0 ,left=0")> <img src="images/KPC/kidsfest_0 4.jpg"></s pan>
Please help!
Bobby
<span class="popup" onClick=javascript:window.
Please help!
Bobby
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
<span class="popup" onClick="..." style="cursor: pointer;"><img src="..."></span>
Joe P
ASKER
Ok BogoJoker, that worked. Thanks.
try this:
<span class="popup" onClick=javascript:window.