MovingBoxes icon indicating copy to clipboard operation
MovingBoxes copied to clipboard

Re-initialize with updating the sizes

Open beshur opened this issue 12 years ago • 3 comments

Hello.

Is there any way to re-initialize the slider and update the slides sizes?

beshur avatar Oct 09 '12 13:10 beshur

Well, it's not really documented, but you can set stored width (or update the width option, which is deprecated) before updating

var slider = $('#slider');
// set a new movingboxes width
slider.data('movingBoxes').width = 300;
// update MovingBoxes
slider.movingBoxes();

Mottie avatar Oct 09 '12 21:10 Mottie

Thank you for reply, Mottie,but that is not what I meant, sorry.

I mean when there is a slider in the display:none div, for example and when the div is revealed its height is expectedly 0.

Is there a way around this with a MovingBoxes script? Thanks. // I know that I can hide the div with position: absolute; visibility: hidden;, initialize the slider and then hide it completely.

beshur avatar Oct 10 '12 05:10 beshur

Ok, when the slider is display:none (or in a parent with such style), it does not tell any data, and also is not accepting methods from outside.

May be handy: I just wrap the slider in a overflow: hidden; height: 0; container when I need to hide it yet need it accessible.

beshur avatar Oct 10 '12 07:10 beshur