Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //On Load
- $(window).on('load', function() {
- var wi = $(window).width();
- if($(window).width() <= 767){ //Veiwport width in pixals
- // do your stuff
- } else {
- // do your stuff
- };
- //On Resize
- $(window).resize(function() {
- var wi = $(window).width();
- if (wi <= 767){ //Veiwport width in pixals
- // copy of above; do your stuff
- } else {
- // copy of above; do your stuff
- };
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement