how can I add JavaScript to png image I'm creating.
I want to add onmouseover and onclick to the picture
Thanks
Guy
image + javascript
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Are you creating the code dynamically??
If you are you can just do this in PHP..
..if you want to dynamically add the onmouseover and onclick actions do this..
..if the code is hard-wired just use this..
..if none of that helps then try to add a bit more detail to your question!
If you are you can just do this in PHP..
Code: Select all
<?php
echo("<img src='img.png' width=100 height=100 onmouseover='do something' onclick='do something else'>");
?>Code: Select all
<?php
$mouseover="do something";
$click="do something else";
echo("<img src='img.png' width=100 height=100 onmouseover='$mouseover' onclick='$click'>");
?>Code: Select all
<img src='img.png' width=100 height=100 onmouseover='do something' onclick='do something else'>