Advertisement
Guest User

Untitled

a guest
May 22nd, 2014
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.64 KB | None | 0 0
  1. $(document).ready(function() {
  2.     var windowSize = $(window).width();
  3.     if (windowSize >= 1200) {
  4.         $('.carousel').css('width','100%');
  5.     }
  6.     if (windowSize >= 800 && windowSize < 1200) {
  7.         $('.carousel').css('width','400');
  8.     }
  9.     if (windowSize >= 400 && windowSize < 800) {
  10.         $('.carousel').css('width','300');
  11.     }  
  12.    
  13.     $(window).resize(function() {
  14.         if( $(this).width() >= 1200 ) {
  15.             $('.carousel').css('width','100%');
  16.         }
  17.        
  18.         if( $(this).width() >= 800 && $(this).width() < 1200) {
  19.         $('.carousel').css('width','400');
  20.         }
  21.        
  22.         if( $(this).width() >= 400 && $(this).width() < 800) {
  23.         $('.carousel').css('width','300');
  24.         }
  25.    
  26. });
  27. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement