Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-initialize with updating the sizes #99

Open
beshur opened this issue Oct 9, 2012 · 3 comments
Open

Re-initialize with updating the sizes #99

beshur opened this issue Oct 9, 2012 · 3 comments

Comments

@beshur
Copy link

beshur commented Oct 9, 2012

Hello.

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

@Mottie
Copy link
Contributor

Mottie commented Oct 9, 2012

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();

@beshur
Copy link
Author

beshur commented Oct 10, 2012

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
Copy link
Author

beshur commented Oct 10, 2012

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants