Advertisement
Guest User

Untitled

a guest
May 23rd, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. //On Load
  2. $(window).on('load', function() {
  3. var wi = $(window).width();
  4. if($(window).width() <= 767){ //Veiwport width in pixals
  5. // do your stuff
  6. } else {
  7. // do your stuff
  8. };
  9. //On Resize
  10. $(window).resize(function() {
  11. var wi = $(window).width();
  12. if (wi <= 767){ //Veiwport width in pixals
  13. // copy of above; do your stuff
  14. } else {
  15. // copy of above; do your stuff
  16. };
  17. });
  18. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement