How can I reset a function implemented with a jquery media query -


i have implemented function on resizing browser window below 1024, works fine when reducing size of browser if enlarge browser window on 1024 newly introduced function stays. how can removed or reset function?

$(window).resize(function() { var width = $(window).width();  // define screen if( width >= 768 && width <= 1024 ) { //     $(function() { // move $("article img").each(function() {     var item = $(this);     item.insertafter(item.next()); });         }); }    }); 

not sure it, you're moving images, originally, have move images ?

$(function() {     $(window).on('resize', function() {         var width = $(window).width();          if ( width >= 768 && width <= 1024 ) {              $("article img").each(function() {                 var item = $(this);                 item.insertafter(item.next());             });                 }else{             $("article img").each(function() {                 var item = $(this);                 item.insertbefore(item.prev());             });                 }     }); }); 

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

How can I fetch data from a web server in an android application? -

jquery - How can I dynamically add a browser tab? -