twentytwenty icon indicating copy to clipboard operation
twentytwenty copied to clipboard

Container Wrong Size Until Resize or Handle Click

Open rebeccab08 opened this issue 3 years ago • 5 comments

I have had the image slider working for a while now but all of a sudden I am experiencing something bizarre. My Image Slider loads with the container larger than the images. If I click on the handle to move it or resize, then it corrects itself.

I have tried adding

$(window).on("load", function () {
      $(window).trigger("resize.twentytwenty");
}); 

but it didn't change anything. Any ideas? Screen Shot 2021-10-14 at 2 12 24 PM

rebeccab08 avatar Oct 12 '21 20:10 rebeccab08

Did you find a solution or workaround? I'm having issues with it displaying any images until you click on the slider handle.

lampyvision avatar Jan 04 '22 16:01 lampyvision

No I did not. I am using it in Squarespace and I noticed that if I put the same code in a code block vs using a gallery block it works....even though its the exact same code... very confusing.

rebeccab08 avatar Jan 04 '22 17:01 rebeccab08

I have still not found a solution. I have tried setting a timeout feature as well as the imagesloaded code. It seems to miscalculate the height of the slider until I click the handle or resize the screen even if I have the timeout set to way past when the images load. Anyone have any ideas??

rebeccab08 avatar Apr 11 '22 19:04 rebeccab08

Have you looked into this issue https://github.com/zurb/twentytwenty/issues/31 I think the 20/20 was attached before images were loaded.

vladdancer avatar May 27 '22 13:05 vladdancer

Have you looked into this issue #31 I think the 20/20 was attached before images were loaded.

Yes, I have tried to set a timeout. I have also tried the images loaded strategy. Sometimes it will load and other times it won't. It seems to be worse if I have more than one on a page.

rebeccab08 avatar May 27 '22 13:05 rebeccab08