This is very simple, I just don't know how it works. I need something in HTML (iphone compatible) that starts off with nothing, and when you click in a certain area, an image appears. This code must be able to work on it's own, without having to reference the head and so on. One piece of code (placed in the body upto 10 times) This could also be a gif that toggles on and off (play/pause) If interested, please give be a timeline and cost. Thanks!
Hi mycompanyname. Sadly I don't have iphone to simulate this, but does the scriopt below suit your need? <a href="javascript:void(0)" onclick="this.childNodes[1].style.display='inline'" onblur="this.childNodes[1].style.display='none';return false;"> CLICKME <img style="position:absolute; display:none; background-color:yellow; width:100px; height:100px;" /> </a> HTML: Hendra
Where does the image go? I don't understand how to use this...but I really appreciate the feedback! : )
The image would be shown on right side of CLICKME text. Clicking any parts outside CLICKME text should hide the image. I just paste the script anywhere inside <body>...</body> tag, so on first load my page would look like (in firefox): "bla bla bla CLICKME bla bla..." Err, I forgot to include the src attribute. Now it should be like: <a href="javascript:void(0)" onclick="this.childNodes[1].style.display='inline'" onblur="this.childNodes[1].style.display='none';return false;"> CLICKME <img [COLOR="red"]src="MYIMAGE.JPG"[/COLOR] style="position:absolute; display:none; background-color:yellow; width:100px; height:100px;" /> </a> Code (markup): Let me know if this works.
Alright, I got the image to show up...is there any way to have the image load in a different area, rather than 'to the right'. Also, I can't get it off, once the image is there...there's no way to turn off.
Okay. Try this updated script: <a href="javascript:void(0)" onclick="[COLOR="red"]this.focus();[/COLOR] this.childNodes[1].style.display='inline';" onblur="this.childNodes[1].style.display='none';"> CLICKME <img src="MYIMAGE.JPG" style="[COLOR="royalblue"]margin-left: 50px; margin-top: 50px;[/COLOR] position:absolute; display:none; background-color:yellow; width:100px; height:100px;" /> </a> Code (markup): Play with the blue margin-left and margin-top attribute above, to control image position. Hendra