css - Twitter Bootstrap Stacking Hierarchy using jQuery -
this layout in desktop
| content | | sidebar |
and wanted acheive in responsive mobile
| sidebar | | content |
i using hubspot create website , dont have prevelidge write pull-right , pull-left classes on span, can guyz let me know in jquery
or javascript
not master in javascript
you should able jquery .before()...
https://api.jquery.com/before/
$(window).on('resize', function () { if ($(window).width() < 768) { $( "#content" ).before( $( "#sidebar" ) ); } }); $(window).trigger('resize');
you .prependto()...
https://api.jquery.com/prependto/
$(window).on('resize', function () { if ($(window).width() < 768) { $('.blog-sidebar').prependto( $('.blog-sidebar').parent() ); } else { $('.blog-sidebar').appendto( $('.blog-sidebar').parent() ); } }); $(window).trigger('resize');
in situation, you'd better using prependto method $('.blog-sidebar')
Comments
Post a Comment