PDA

View Full Version : Javascript Help



Jamieb
02-01-2008, 11:07 AM
I got his code


<head>
<script type="text/javascript">
<!--
function myPopup2() {
window.open( "http://www.google.com/", "myWindow",
"status = 1, height = 300, width = 300, resizable = 0" )
}
//-->
</script>
</head>
<body>
<form>
<input type="button" onClick="myPopup2()" value="POP2!">
</form>
</body>But u have to press a button how do i change it to a image?

Moved by Agesilaus (Forum Moderator) from Designing & Development: Please post in the correct forum next time. :)

[Oli]
02-01-2008, 11:16 AM
I think it was:

could be wrong, I never use this



<input type="image" src="path/to/link" onClick="myPopup2()" value="POP2!">


that or simply give the button a class & do it in css using background image

Robbie
02-01-2008, 11:18 AM
<head>
<script type="text/javascript">
<!--
function myPopup2() {
window.open( "http://www.google.com/", "myWindow",
"status = 1, height = 300, width = 300, resizable = 0" )
}
//-->
</script>
</head>
<body>
<form>
<a href="#"><img src="IMG URL" onClick="myPopup2()" border="0"></a>
</form>
</body>

Jamieb
02-01-2008, 11:45 AM
Thanks! Ill try when my host back up +rep both If I can.

Want to hide these adverts? Register an account for free!