||08-09-2009 03:00 PM
Update Text if div is showing or hiding
Hi i found this code however it is not updating the text correctly on my computer.
var element = document.getElementById(elementId);
if(element.style.display != "block")
element.style.display = "block";
element.style.display = "none";
if(element.innerHTML.indexOf("Show") = -1)
element.innerHTML = "show<img src='images/YOUR THEME /fastreply.gif'>";
element.innerHTML = "hide<img src='images/YOUR THEME/fastreply.gif'>";
If anyone can help that would be alsome, I thought it was the UpdateText because I have more then one of these on the same page since it prints it 10 times.
But after 5 hours working at it, can't get it to work...
please help if you can
||08-09-2009 07:09 PM
- Why are you assigning a value in the 2nd if statement?
- Why are you not just checking if the image is displayed and if so set it's .style to hidden. (Then vise-versa)
- It would help if we had more context (what exactly you're trying).
|All times are GMT. The time now is 10:06 PM.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0