-
-
Save joelbrennan0/9eb737fc899eff05dfe7f6468a6a8acc to your computer and use it in GitHub Desktop.
JavaScript Function Move HTML Element - Reorder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Move an element withing the DOM at 992 window width - additional CSS required | |
var moveHtmlElement = function(init_el, add_cl, rm_cl, target_el, return_el) { | |
if ($(window).width() < 992) { | |
$(init_el).addClass(add_cl); | |
$(init_el).removeClass(rm_cl); | |
$(init_el).insertAfter(target_el); | |
} else { | |
$(init_el).addClass(rm_cl); | |
$(init_el).removeClass(add_cl); | |
$(init_el).insertAfter(return_el); | |
} | |
} | |
//moveHtmlElement('.m-changeable', 'm-block pull-right ad', 'm-none', '.navbar-header', '#before-btns'); | |
//resise checker | |
//$( window ).resize(function() { | |
// moveHtmlElement('.m-changeable', 'm-block pull-right ad', 'm-none', '.navbar-header', '#before-btns'); | |
//}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment