Created
December 6, 2016 00:43
-
-
Save malachi358/d6c6c555a14df93eaa579aadda13b8cc to your computer and use it in GitHub Desktop.
Change place of divs in dom based on width of device
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
// Change place of divs in dom based on width of device ================================ | |
$(window).resize(function(){ | |
resize(); | |
}); | |
$(document).ready(function(){ | |
resize(); | |
}); | |
function resize(){ | |
if($(window).width() < 767) | |
{ | |
//Mobile | |
$(".sidebar").insertAfter(".section.product_section"); | |
} | |
else | |
{ | |
//Desktop | |
//Leave original layout | |
$(".sidebar").insertBefore(".content .twelve.columns"); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment