Answers for "jquery only on mobile"

0

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');
        }
    }
});
Posted by: Guest on April-13-2021

Code answers related to "jquery only on mobile"

Code answers related to "Javascript"

Browse Popular Code Answers by Language