Saturday, 23 March 2019

How do we apply jQuery for mobile only

 <script>
    $(document).ready(function () {
    $(window).on("resize", function (e) {
        checkScreenSize();
    });

    checkScreenSize();

    function checkScreenSize(){
        var newWindowWidth = $(window).width();
        if (newWindowWidth < 768) {
            jQuery(".recent-insight").insertAfter(".sidebar-right");
            $(".relateds .action-links ").insertBefore(".mob-block .vc_btn3-container");
        }else{
          $(".mob-block .action-links ").insertBefore(".relateds .vc_btn3-container");
        }
      
    }
});
  </script>

No comments:

Post a Comment