Hi everyone,

Im trying to get this hide, show, gife image to work on multiple pages but it seems to be working only on the first page not on the other pages?

here is my code:


echo "<div id=\"headerDivImg\" class=\"displayTitle\">$title_txt<a id=\"imageDivLink\" href=\"javascript:toggleDiv('contentDivImg', 'imageDivLink');\"><img src=\"../img/minus-2.png\"></a> </div> ";
echo "<div class='maintitles_jd' id='contentDivImg' style='display:block;' >"; //job description content

<script type="text/javascript">
function toggleDiv(showHideDiv, switchImgTag) {
var ele = document.getElementById(showHideDiv);
var imageEle = document.getElementById(switchImgTag);

if(ele.style.display == "block") {
ele.style.display = "none";
imageEle.innerHTML = '<img src="../img/plus-2.png">';
}
else {
ele.style.display = "block";
imageEle.innerHTML = '<img src="../img/minus-2.png">';
}

}
</script>