Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Nov 2010
    Posts
    15
    Thanks
    4
    Thanked 0 Times in 0 Posts

    - Image gallery thumbnails problem in Safari

    Okay,

    So I have an image gallery set up using AD Gallery (http://coffeescripter.com/code/ad-gallery/). I have gone in and tweaked some of the code, but mainly just CSS changes and not too many JS changes, so I am fairly positive I haven't inadvertently caused the problem.

    The problem I am facing is that when the gallery is viewed in Safari, the thumbnail container ( a ul) is set to 100px width. In firefox it works correct. Basically the ul is supposed to dynamically adjust to the number of thumbnails and all the images are loaded from a directory via php.

    The snippet of code out of the ad-gallery javascript that sets the width is as follows:

    Code:
    // Wait until all thumbs are loaded, and then set the width of the ul
          var inter = setInterval(
            function() {
              if(thumb_count == thumbs_loaded) {
                thumb_wrapper_width -= 100;
                var list = context.nav.find('.ad-thumb-list');
                list.css('width', thumb_wrapper_width +'px');
                var i = 1;
                var last_height = list.height();
                while(i < 201) {
                  list.css('width', (thumb_wrapper_width + i) +'px');
                  if(last_height != list.height()) {
                    break;
                  }
                  last_height = list.height();
                  i++;
                }
                clearInterval(inter);
              };
            },
            100
          );
        },
    Any help is greatly appreciated!
    Last edited by JasonSims; 12-02-2010 at 03:10 AM. Reason: correct code tags

  • #2
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,788
    Thanks
    8
    Thanked 131 Times in 129 Posts
    http://web.enavu.com/daily-tip/daily...oad-in-jquery/

    have a look at that. I suspect it might be your answer.
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis


  •  

    Posting Permissions

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