Advertisement
pasteNinja

Untitled

Feb 13th, 2015
214
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.                 $("body").backstretch([
  27.                     "http://simonepasqualini.it/wp-content/uploads/bk-4.jpg",
  28.                     "http://simonepasqualini.it/wp-content/uploads/bk-3.jpg",
  29.                     "http://simonepasqualini.it/wp-content/uploads/bk-2.jpg",
  30.                 ], {duration: 3000, fade: 1200});
  31.            
  32.                 $('#next').click(function(x) {
  33.                      x.preventDefault();
  34.                      $('body').data('backstretch').next();
  35.                 });
  36.                 $('#prev').click(function(x) {
  37.                      x.preventDefault();
  38.                         $('body').data('backstretch').prev();
  39.                 });
  40.            
  41.         }
  42.        
  43.         initPageBackground();  
  44.        
  45.     });
  46. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement