PDA

View Full Version : Ultimate Fade-in slideshow (v2.4) - Errors in Internet Explorer?



That Guy
07-12-2010, 02:24 AM
1) Script Title: Ultimate Fade-in slideshow (v2.4)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

3) Describe problem:

I have used this script on a few sites with no problems but seem to be having problems with it on a shopping cart.

It loads up and works spot on but in Internet Explorer 8 it is showing 7 errors (bottom left hand corner) anyone know what the problem is and how it can be fixed?

jscheuer1
07-12-2010, 02:43 AM
I think you may also have other problems. However, a major issue is that Ultimate Fade-In is written in and switches to jQuery no conflict mode and you are using other jQuery code on the page.

You have two options. Either change your other jQuery code to no conflict mode (probably unnecessary and a fair amount of work), or remove this line (it's near the top) from fadeslideshow.js:


jQuery.noConflict()

That Guy
07-12-2010, 01:33 PM
Thank You so much, that seems to have fixed the problem :)

Thanks for the quick reply!

That Guy
07-12-2010, 02:57 PM
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?


<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 :confused:

jscheuer1
07-12-2010, 03:41 PM
The best solution is to not allow the script to be associated with any page it's not being used on.

This can be done by removing it from the template and hard coding it to the page it is used on. Or you can use server side code in the template to include it only where needed.

If that's not possible (I'm sure it is - as both the fadeinslideshow.js external script tag and the on page initialization script can go in the body if they're the first things after the opening <body> tag), this will work (don't miss the added bit at the end):


jQuery(function($){
if($('#slideshow').length === 1)
window.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: ""
})
});

That Guy
07-12-2010, 03:47 PM
Thank You,

So if I have read your solution correct, if I remove the line you have highlighted the script will still run on all pages but it will not show an error message?

jscheuer1
07-12-2010, 03:56 PM
Reread it. I've edited it because I found a better solution. If it (my previous post) still looks the same, refresh your browser.

That Guy
07-12-2010, 04:14 PM
Reread it. I've edited it because I found a better solution. If it (my previous post) still looks the same, refresh your browser.

Thank You works perfect!

You are a legend :)