MovingBoxes icon indicating copy to clipboard operation
MovingBoxes copied to clipboard

Remove moving boxes?

Open raphaelluchini opened this issue 12 years ago • 1 comments

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

raphaelluchini avatar May 29 '13 01:05 raphaelluchini

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

Mottie avatar May 29 '13 13:05 Mottie