esandra Posted December 10, 2010 Share Posted December 10, 2010 if this image is clicked: <img src="images/del.png" width="15" height="15" onclick="hide(<?php echo $y;?>)"> this image should appear: <img src="images/undo.png" width="20" height="20" onclick="show(<?php echo $y;?>)" title="undo"> 2nd image won't replace the first one, it will appear somewhere else Quote Link to comment https://forums.phpfreaks.com/topic/221181-check-if-the-image-is-clicked/ Share on other sites More sharing options...
btherl Posted December 10, 2010 Share Posted December 10, 2010 That sounds like something for javascript. Quote Link to comment https://forums.phpfreaks.com/topic/221181-check-if-the-image-is-clicked/#findComment-1145213 Share on other sites More sharing options...
esandra Posted December 10, 2010 Author Share Posted December 10, 2010 will I be allowed to repost this in that forum instead? Quote Link to comment https://forums.phpfreaks.com/topic/221181-check-if-the-image-is-clicked/#findComment-1145223 Share on other sites More sharing options...
Pikachu2000 Posted December 10, 2010 Share Posted December 10, 2010 will I be allowed to repost this in that forum instead? Moved . . . Quote Link to comment https://forums.phpfreaks.com/topic/221181-check-if-the-image-is-clicked/#findComment-1145231 Share on other sites More sharing options...
RichardRotterdam Posted December 10, 2010 Share Posted December 10, 2010 Here is a simple example with buttons instead of images. You could easily change the buttons for images. <script type="text/javascript"> window.onload = function() { // fetch delete button from DOM using var deleteButton = document.getElementById('delete_button'); // fetch undo button from DOM wich is hidden using CSS var undoButton = document.getElementById('undo_button'); // set onclick event for the delete button deleteButton.onclick = function() { // set the style to inline of the undo button so its not hidden any more undoButton.style.display = 'inline'; } } </script> <button id="delete_button">Delete</button> <button id="undo_button" style="display:none;">Undo</button> Quote Link to comment https://forums.phpfreaks.com/topic/221181-check-if-the-image-is-clicked/#findComment-1145514 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.