Advertisement
pasteNinja

Untitled

Feb 13th, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function($){
  2.     $(function() //Document ready event
  3.     {
  4.    
  5.     //Sidebar navigation
  6.     $('.nav-toggle').click(function(){
  7.         $('.main-sidebar').toggleClass('toggle-on');
  8.         $('.section-wrapper').toggleClass('toggle-on');
  9.         });
  10.        
  11.     //Height forced 100%       
  12.     function setDimensions(){
  13.     var windowsHeight = $(window).height();
  14.             $('.background,.section-wrapper ').css('height', windowsHeight + 'px');
  15.             }
  16.            
  17.     //when resizing the site, we adjust the heights of the sections
  18.     $(window).resize(function() {
  19.             setDimensions();
  20.         });
  21.  
  22.         setDimensions();
  23.        
  24.     function initPageBackground() {
  25.            
  26.             if( $('body').hasClass('slide-background') ) {
  27.            
  28.                 $("body").backstretch([
  29.                     "http://simonepasqualini.it/wp-content/uploads/bk-4.jpg",
  30.                     "http://simonepasqualini.it/wp-content/uploads/bk-3.jpg",
  31.                     "http://simonepasqualini.it/wp-content/uploads/bk-2.jpg",
  32.                 ], {duration: 3000, fade: 1200});
  33.            
  34.                 $('#next').click(function(x) {
  35.                      x.preventDefault();
  36.                      $('body').data('backstretch').next();
  37.                 });
  38.                 $('#prev').click(function(x) {
  39.                      x.preventDefault();
  40.                         $('body').data('backstretch').prev();
  41.                 });
  42.  
  43.             } else if($('body').hasClass('image-background')) {
  44.            
  45.                 $("body").backstretch([
  46.                     "http://simonepasqualini.it/wp-content/uploads/bk-4.jpg"
  47.                 ]);
  48.                
  49.             } else if($('body').hasClass('image-gradient-background')) {
  50.                
  51.                 $("body").backstretch([
  52.                     "http://simonepasqualini.it/wp-content/uploads/bk-4.jpg"
  53.                 ]);
  54.                
  55.             }  
  56.            
  57.         }
  58.        
  59.         initPageBackground();  
  60.        
  61.     });
  62. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement