Closed tomeralmog closed 9 years ago
I have also changed the randomness of the fillers like this:
line 191 (before the 2 for loops) add var fillerNum = $(settings.filler.itemSelector).length;
and then in line 212 change
ran = Math.floor(Math.random() * $(settings.filler.itemSelector).length);
to
ran = fillerNum -1;
you can probably add another Boolean variable in the option field for random true/false and set it there.
Hope this helps, Thanks for the great plugin! Tomer Almog www.tomeralmog.com
Hey tom mind doing a fork and pull request?
No Problem brother
HI, Thank you for the plugin. I needed the layout to be predetermined (i.e. I need to know which image to put on a [2,1] layout and on [1,2]. I have extended a bit the plugin to enable that (you might want to include that on your next release): on line 112 I have changed ran = Math.floor(Math.random() * (settings.sizes.length - settings.promoted.length)); to ran = $sel.data("layout"); if(typeof(ran)=='undefined' || !ran){ ran = Math.floor(Math.random() * (settings.sizes.length - settings.promoted.length)); }
Now in the HTML you can add data-layout attribute which corresponds to the index of the sizes in the options: div class='box' data-layout="3">4