germanysbestkeptsecret / Wookmark-jQuery

A jQuery plugin to create a dynamic, multi-column layout.
MIT License
2.64k stars 759 forks source link

Generated boxes 'jump' for a split second when it loads.. #202

Closed shannont closed 8 years ago

shannont commented 9 years ago

I am using Chrome on Mac and noticed that when the content is generated, the boxes seem to stick together as if they had no padding and then 'jump' outwards into their correct positions when loaded. It only happens for a split second but it's noticeable. Does anyone know what could be wrong?

I use the code like this:

             (function ($) {
              var wookmark;

                wookmark = new Wookmark('.tiles-wrap', {
                  container: $('.products'),
                  itemWidth: 250,
                  offset: 20,
                  align: 'center'
              });
               })(jQuery);

And the .products has this CSS:

                .products{
               width: 940px;
               position: relative;
                 }

Is it something I am doing wrong? I run the jQuery right after the content HTML.

Sebobo commented 9 years ago

Hi,

this happens currently when you use the css transitions. The reason is that the elements initially have a position of 0:0 and then get the correct position and your browser wants to animate that. This has worked before and I realised that few days ago too. Maybe a regression there.

I will mark this as need to be fixed. Maybe this can easily be fixed with css but I have to check.

Sebobo commented 8 years ago

This is now fixed in 2.1.0