Advertisement
Guest User

Untitled

a guest
Oct 21st, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* ------------------------------------------------------------------------ */
  2. /*  BACKGROUNDS
  3. /* ------------------------------------------------------------------------ */ 
  4. function initPageBackground() {
  5.     if( $('body').hasClass('slideshow-background') ) { // SLIDESHOW BACKGROUND
  6.    
  7.         $("body").backstretch([
  8.             "http://placehold.it/1920x1200",
  9.             "http://placehold.it/1920x1200",
  10.             "http://placehold.it/1920x1200",
  11.         ], {duration: 3000, fade: 1200});
  12.    
  13.     } else if($('body').hasClass('image-background')) { // IMAGE BACKGROUND
  14.    
  15.         $("body").backstretch([
  16.             "http://placehold.it/1920x1200"
  17.         ]);
  18.        
  19.     } else if($('body').hasClass('parallax-background')) { // PARALLAX BACKGROUND
  20.    
  21.         $.parallaxify({
  22.             positionProperty: 'transform',
  23.             responsive: true,
  24.             motionType: 'natural',
  25.             mouseMotionType: 'performance',
  26.             motionAngleX: 70,
  27.             motionAngleY: 70,
  28.             alphaFilter: 0.5,
  29.             adjustBasePosition: true,
  30.             alphaPosition: 0.025,
  31.         });
  32.        
  33.     } else if( $('body').hasClass('youtube-background')) { // YOUTUBE VIDEO BACKGROUND
  34.         if($('body').hasClass('mobile')) { // MOBILE BACKGROUND - Image background instead of video on mobile devices
  35.            
  36.             // Default background on mobile devices
  37.             $("body").backstretch([
  38.                 "video.jpg"
  39.             ]);
  40.            
  41.         } else {
  42.             $(".player").each(function() {
  43.                 $(".player").mb_YTPlayer();
  44.             });
  45.         }
  46.        
  47.     } else if( $('body').hasClass('mobile') ) { // MOBILE BACKGROUND - Image background instead of video on mobile devices
  48.         if($('body').hasClass('video-background')) {
  49.            
  50.             // Default background on mobile devices
  51.             $("body").backstretch([
  52.                 "video.jpg"
  53.             ]);
  54.            
  55.         }  
  56.     }
  57. }
  58.  
  59. initPageBackground();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement