Re: Javascript issue

Originally Posted by
TheBuz
hi dave west, thanks for your help so far. I have managed to get the script to run on just the products pages. although i don't think i did it right. As other javascript on that page (Ajax image swapper) is being hidden as well.
for some reason the code would only work if it was in \modules\pages\product_info\jscript_main.php
AND tpl_product_info_display.php
i put the CSS code in jscript_main.php as i didn't know where to put it in the stylesheet and it worked apart from the problem above. do you think there is a way around this or are the two scripts going to fight with each other? thanks again :)
Placing the style into jscript_main.php would work if you placed it outside of the javascript tags with the style tags in place, just not a clean way of doing it with Zen.
I use this type of code for my floating login box.
The key to the code is that it needs to run during page load and it uses the ID tags to make the switch. If your Ajax image swapper is using the same ID as the loading image... then it to would hide. On loading image change id="loading" to something like id="myloading" as will, change the script to
Code:
<script type="text/javascript">
document.getElementById("myloading").className = "loading-visible";
window.onload=function(){
document.getElementById("myloading").className = "loading-invisible";
}
</script>
Dave
Always forward thinking... Lost my mind!