I’m new to jQuery and I don’t know what is the best function to replace this:
<span id="fcp-vicon" onClick="be_visible()"><img src="'.$path.'img/blueicons/hidden.jpg" alt="Cambiar a Modo Visible"/></span>
With this:
<span id="fcp-vicon" onClick="be_hidden()"><img src="'.$path.'img/blueicons/visible.jpg" alt="Cambiar a Modo Invisible"/></span>
The idea is that image works like a switch to toggle the visibility of other field.
Thank you very much.
Thanks, I need to change the span itself, so I need to change the related image and the inline onClick event.
To add to loktar’s answer…
I assume what you want is an image that toggles the visibility of something else (lets say a div).
What you need is this html:
and something like this jquery:
With jquery there is no need for inline javascript! 🙂
EDIT
Sorry, didn’t realise you were changing the image each time…
Ok the best way to do this is to have two images in your span! 🙂
And jquery:
This might help: http://jsfiddle.net/tclayson/tPWNN/