run the jquery only in mobile screen code example
Example: jquery only on mobile
$(document).ready(function () {
$(window).on("resize", function (e) {
checkScreenSize();
});
checkScreenSize();
function checkScreenSize(){
var newWindowWidth = $(window).width();
if (newWindowWidth < 481) {
$('.right').insertBefore('.left');
}
else
{
$('.left').insertBefore('.right');
}
}
});