Results 1 to 6 of 6

Thread: Simple Controls Gallery v1.4 hangs on ajaxload.gif with ie7

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

    Default Simple Controls Gallery v1.4 hangs on ajaxload.gif with ie7

    1) Simple Controls Gallery v1.4

    2) http://www.dynamicdrive.com/dynamici...plegallery.htm

    3) Describe problem:

    You can verify this by going to the script demo page (I'm using ie7 on XP):
    It works normally when visiting the page for the first time, or when refreshing. However, navigate to any other page and then back and you'll see it's hung on the ajaxloading.gif. Entering the url again, or seleting the url in the address bar and pressing enter also triggers the issue.

    Please let me know if you can come up with a solution, other than that it's great. Thank you.

  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've moved this to bug reports since its reproducible on the official demo page, just as you say. It also happens in IE 9 on Windows 7 if you view it in the IE 7 or IE 8 modes.

    There's an easy fix though. Find this section in the simplegallery.js script (around line #41):

    Code:
    	for (var i=0; i<setting.imagearray.length; i++){  //preload slideshow images
    		preloadimages[i]=new Image()
    		preloadimages[i].src=setting.imagearray[i][0]
    		if (setting.imagearray[i][3] && setting.imagearray[i][3].length>setting.longestdesc.length)
    			setting.longestdesc=setting.imagearray[i][3]
    		jQuery(preloadimages[i]).bind('load error', function(){
    			loadedimages++
    			if (loadedimages==setting.imagearray.length){
    				dfd.resolve() //indicate all images have been loaded
    			}
    		})
    	}
    Move it up a little like so:

    Code:
    	for (var i=0; i<setting.imagearray.length; i++){  //preload slideshow images
    		preloadimages[i]=new Image()
    		jQuery(preloadimages[i]).bind('load error', function(){
    			loadedimages++
    			if (loadedimages==setting.imagearray.length){
    				dfd.resolve() //indicate all images have been loaded
    			}
    		})
    		preloadimages[i].src=setting.imagearray[i][0]
    		if (setting.imagearray[i][3] && setting.imagearray[i][3].length>setting.longestdesc.length)
    			setting.longestdesc=setting.imagearray[i][3]
    	}
    The key is to bind the onload/onerror code to the image before the src is assigned. What was happening was that, with everything cached the load event was firing before the behavior for it was bound. With this new order to the code that cannot happen.
    - 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:

    nova62400 (06-02-2011)

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

    Default

    Thank you for sharing the solution. I have applied it on our site and are testing it at the moment without a problem.

  5. #4
    Join Date
    Oct 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,
    I have the same problem and tried the solution as stated above. Unfortunately, without any succes. Any other advice?
    Thanks

  6. #5
    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

    Quote Originally Posted by R. Vreeken View Post
    Hi,
    I have the same problem and tried the solution as stated above. Unfortunately, without any succes. Any other advice?
    Thanks
    If you truly have the same problem, and the script hasn't been updated in some way that makes using this solution impractical/more challenging since the solution in this thread was put forth (check the dates on the posts visa vis the update history of the script), just make sure you've saved the changes and are using the new simplegallery.js script file.

    The browser cache may need to be cleared and/or the page refreshed to see changes.

    If you want more help:

    Please post a link to a page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

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

  7. #6
    Join Date
    Oct 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    John,
    Thanks for your reply.
    In the meanwhile the problem is solved. At first I moved the code on one of my webpages and left the code on other webpages unchanged. This didn't help untill I moved the code on all pages.
    Now it works fine.

    Thanks again.

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
  •