Results 1 to 3 of 3

Thread: Ultimate FadeIn Slideshow issue on ASP page(s)

  1. #1
    Join Date
    Jun 2011
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    1) Script Title: Ultimate Fade-In Slideshow v2.4

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...nslideshow.htm

    3) Describe problem: can't load multiple slideshows on different ASP pages

    I have a generic ASP page as a template, which then loads different pages into the template. I am able to run 1 instance of the slideshow on any page, but when I try to run a second instance on a different page, it doesn't work. If the slideshows are both on the same page, then they both work. Using Firebug, I have found the following error on the 2nd page from within the javascript:

    Code:
    $curimage.get(0) is undefined
    [Break On This Error] if ($curimage.get(0).complete){ //accounf for IE not firing image.onload
    Since the ASP page is just a template, both instances are loaded into the same HEAD. On the second page, if I rename the DIV to the ID of the first slideshow, it works just fine.

    Any thoughts on how I can get this to work? I'm typically a PHP coder, but have been asked to help out on this project, so I am learning ASP as I go. Thanks!

    Here is a link to the page if needed for troubleshooting:

    www.bgark.com/testdefault.asp

    Slideshow 1 is on the Home page, and Slideshow 2 is on the Projects page.
    Last edited by jscheuer1; 06-06-2011 at 06:40 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I see you've modified the fadeslideshow.js script here:

    Code:
    	jQuery(document).ready(function($){ //fire on DOM ready
    		var setting=slideshow.setting
    		var fullhtml=fadeSlideShow.routines.getFullHTML(setting.imagearray) //get full HTML of entire slideshow
    		setting.$wrapperdiv=$('#'+setting.wrapperid).css({position:'relative', visibility:'visible', background:'black', overflow:'hidden', width:setting.dimensions[0], height:setting.dimensions[1]}).empty() //main slideshow DIV
    //		if (setting.$wrapperdiv.length==0){ //if no wrapper DIV found
    //			alert("Error: DIV with ID \""+setting.wrapperid+"\" not found on page.")
    //			return
    //		}
    What that does is allow it to continue on initializing even when the markup for the show is not there. That's what causes the error.

    I'm pretty sure you did that to avoid the alert because you found it too difficult to only initialize only the slideshow, if any on any particular page. This often happens with server side includes/templates as one can have with asp, PHP, or any of the various others.

    If you instead make it like so:

    Code:
    	jQuery(document).ready(function($){ //fire on DOM ready
    		var setting=slideshow.setting
    		var fullhtml=fadeSlideShow.routines.getFullHTML(setting.imagearray) //get full HTML of entire slideshow
    		setting.$wrapperdiv=$('#'+setting.wrapperid).css({position:'relative', visibility:'visible', background:'black', overflow:'hidden', width:setting.dimensions[0], height:setting.dimensions[1]}).empty() //main slideshow DIV
    		if (setting.$wrapperdiv.length==0){ //if no wrapper DIV found
    //			alert("Error: DIV with ID \""+setting.wrapperid+"\" not found on page.")
    			return
    		}
    leaving the rest of that section intact, it will still avoid the alert. But it will also exit (return) without trying to continue. This has been the solution in many similar cases.

    It may or may not be the only problem, but it has to be fixed first.

    Make sure to upload the changes, clear the cache and refresh the pages before gaging the results.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    bszopi (06-06-2011)

  4. #3
    Join Date
    Jun 2011
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    If you instead make it like so:

    Code:
    	jQuery(document).ready(function($){ //fire on DOM ready
    		var setting=slideshow.setting
    		var fullhtml=fadeSlideShow.routines.getFullHTML(setting.imagearray) //get full HTML of entire slideshow
    		setting.$wrapperdiv=$('#'+setting.wrapperid).css({position:'relative', visibility:'visible', background:'black', overflow:'hidden', width:setting.dimensions[0], height:setting.dimensions[1]}).empty() //main slideshow DIV
    		if (setting.$wrapperdiv.length==0){ //if no wrapper DIV found
    //			alert("Error: DIV with ID \""+setting.wrapperid+"\" not found on page.")
    			return
    		}
    leaving the rest of that section intact, it will still avoid the alert. But it will also exit (return) without trying to continue. This has been the solution in many similar cases.

    That worked perfectly. Thanks! I should have thought to check out the js more closely...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •