Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ------------------------------------------------------------------------ */
- /* BACKGROUNDS
- /* ------------------------------------------------------------------------ */
- function initPageBackground() {
- if( $('body').hasClass('slideshow-background') ) { // SLIDESHOW BACKGROUND
- $("body").backstretch([
- "http://placehold.it/1920x1200",
- "http://placehold.it/1920x1200",
- "http://placehold.it/1920x1200",
- ], {duration: 3000, fade: 1200});
- } else if($('body').hasClass('image-background')) { // IMAGE BACKGROUND
- $("body").backstretch([
- "http://placehold.it/1920x1200"
- ]);
- } else if($('body').hasClass('parallax-background')) { // PARALLAX BACKGROUND
- $.parallaxify({
- positionProperty: 'transform',
- responsive: true,
- motionType: 'natural',
- mouseMotionType: 'performance',
- motionAngleX: 70,
- motionAngleY: 70,
- alphaFilter: 0.5,
- adjustBasePosition: true,
- alphaPosition: 0.025,
- });
- } else if( $('body').hasClass('youtube-background')) { // YOUTUBE VIDEO BACKGROUND
- if($('body').hasClass('mobile')) { // MOBILE BACKGROUND - Image background instead of video on mobile devices
- // Default background on mobile devices
- $("body").backstretch([
- "video.jpg"
- ]);
- } else {
- $(".player").each(function() {
- $(".player").mb_YTPlayer();
- });
- }
- } else if( $('body').hasClass('mobile') ) { // MOBILE BACKGROUND - Image background instead of video on mobile devices
- if($('body').hasClass('video-background')) {
- // Default background on mobile devices
- $("body").backstretch([
- "video.jpg"
- ]);
- }
- }
- }
- initPageBackground();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement