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

Remove moving boxes? #117

Open
raphaelluchini opened this issue May 29, 2013 · 1 comment
Open

Remove moving boxes? #117

raphaelluchini opened this issue May 29, 2013 · 1 comment

Comments

@raphaelluchini
Copy link

Hello, I would like know if has a easy mode to remove the Moving Boxes, like a dispose() and remove all classes from html?

My Problem:
I want keep Moving Boxes on Desktop, but for small devices, changes to a simple ul

Hard solutions:
Using media queries, remove all styles from slider
or
Remove all classes from ul with JS

Thank You

@Mottie
Copy link
Contributor

Mottie commented May 29, 2013

Hi @raphaelluchini!

There isn't anything built-in yet to remove (destroy) MovingBoxes, but you can use this code to remove it (demo):

var mb = $('#slider').data('movingBoxes');
mb.$wrap.find('.mb-scrollButtons, .mb-left-shadow, .mb-right-shadow, .mb-controls').remove();
mb.$el
    .removeClass('mb-slider')
    .removeAttr('style')
    .children()
    .removeClass('mb-panel current')
    .removeAttr('style')
mb.$panels.find('.mb-inside').each(function(){
    $(this).replaceWith( $(this).contents() );
});
mb.$el.unwrap().unwrap();

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