OK Spoke to soon I have another problem:
I am adding a slideshow to the front page of a website I am creating using OpenCart.
I have to add the following to the header.tpl file, this file is loaded for all pages.
The script below looks for a div with an id of "slideshow", this div is only on the front page so when you navigate to a different page you get a message popup saying "Error: DIV with ID "slideshow" not found on page."
Is there any way to edit the script below so it does not bring up a nag message when it cannot find the div?
Code:
<script type="text/javascript">
var mygallery=new fadeSlideShow({
wrapperid: "slideshow",
dimensions: [570, 200],
imagearray: [
["catalog/view/theme/default/image/slide1.png", "http://www.MYDOMAIN.co.uk"],
["catalog/view/theme/default/image/slide2.png", "http://www.MYDOMAIN.co.uk"],
["catalog/view/theme/default/image/slide3.png", "http://www.MYDOMAIN.co.uk"]
],
displaymode: {type:'auto', pause:5000, cycles:0, wraparound:false},
persist: false,
fadeduration: 500,
descreveal: "ondemand",
togglerid: ""
})
</script>
Or maybe I could wrap the code with some sort of code that means it will only run on the index page?
Any help with this would be great, its driving me nuts
Bookmarks