twentytwenty icon indicating copy to clipboard operation
twentytwenty copied to clipboard

Only loads on browser refresh

Open sarahkloth opened this issue 9 years ago • 6 comments

I have added the TwentyTwenty plugin for wordpress and it seems to only be loading on browser refresh. Anyone experience this? If you click into any of these you can see what I mean: http://preview.lhkruegerandson.com/before-after-gallery/

sarahkloth avatar Jun 17 '15 18:06 sarahkloth

I have the same problem :/

bartoszhernas avatar Oct 29 '15 00:10 bartoszhernas

same issue here, maybe use a plugin to load twentytwenty after all images are loaded? I'll test this tomorrow

rubenheymans avatar Oct 29 '15 16:10 rubenheymans

https://github.com/desandro/imagesloaded

rubenheymans avatar Oct 29 '15 16:10 rubenheymans

Issue #31 is the same and they gave a fix in comments :)

bartoszhernas avatar Oct 29 '15 16:10 bartoszhernas

Using imageloaded is slightly better than using a timeout, if the images are still not loaded after your timeout it still won't work

        $('.before-after').imagesLoaded( function() {
            $('.before-after').twentytwenty();
        });

rubenheymans avatar Oct 30 '15 07:10 rubenheymans

This made a trick for me:

      <div class="twentytwenty-container" id="images">
        <img id="myImg" src="galeria/slider/<?php echo($id)?>a.jpg" />
        <img id="myImg" src="galeria/slider/<?php echo($id)?>b.jpg" />
      </div>

    <script>

$(window).on('load',function() {
  $("#images").twentytwenty();
});
    </script>

tdowgielewicz avatar Jul 17 '18 19:07 tdowgielewicz