Multiple Gallery into TabPages

May 31, 2012 at 10:55 AM
Edited May 31, 2012 at 1:52 PM

Dear All,
I try to make a page with multiple ad-gallery instance, each one into a TabPage.
The first gallery is shown correcly, but the others (that there are into a "display:none" div) are not display correctly.

Probably the jquery call for determinate width of the divs are broken because the elements are not visible?

Is there some tricks to make it works correctly?

Thanks a lot

Claudio Cas

 

Edit: The main image size can be fixed using explicit width and height in adgallery jquery invocation

        var galleries = $('#galleryHidden').adGallery({
          loader_image: 'loader.gif',
          width: 610, 
          height: 458
        });

 

Edit 2: Internet Explorer vs Firefox and Chrome

 

 context.whenImageLoaded(thumb[0], function() {
                var width = thumb[0].parentNode.parentNode.offsetWidth;
                alert("Width >" + width + ", ThumbWidth > " + thumb[0].width);

                if (thumb[0].width == 0) {
                    // If the browser tells us that the image is loaded, but the width
                    // is still 0 for some reason, we default to 100px width.
                    // It's not very nice, but it's better than 0.
                    width = 100;
                };
                context.thumbs_wrapper_width += width;
                thumbs_loaded++;
            });

In this code first calculate var width, but after the if is on the thumb[0].width.
When the gallery is In IE width and thumb[0].width are 0 both, but in FF and Chrome the thumb[0].width is the right image size but the variable width is 0, so thumbs_wrapper_width still 0.
But also in IE there still some issue, becuase after set the wrapper_width to default 100px * image something was call and the final width (see using inspector) is incorrect (not default 100px * image).

 

Now I will try to undestund how to walkaround the thumbs issue..