-
-
Save hristiank/f2a315d406aa1ff47e1a7bbc85c56dc1 to your computer and use it in GitHub Desktop.
Full Width Sliding Images
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setFullScreen() { | |
var fs = {}; | |
fs.preinit = function() { | |
$('#lp-pom-root').css({ | |
'min-width': 'auto', | |
margin: 0, | |
//If you have a single section page and want full width AND height | |
//overflow: 'hidden', | |
height: 'auto' | |
}); | |
$('.lp-positioned-content').css({ | |
left: 0, | |
top: 0, | |
margin: 0, | |
padding: 0, | |
width: 'auto' | |
}); | |
$('[id$="overlay"]').remove(); | |
} | |
fs.reinit = function() { | |
fs.width = $(window).width(); | |
fs.height = $(window).height(); | |
fs.update(); | |
} | |
fs.set = function(el) { | |
el.css({ | |
width: fs.width, | |
// See full width AND height comment on line 8 above | |
//height: fs.height | |
}); | |
} | |
fs.update = function() { | |
var $container = $('#lp-pom-box-9'); | |
var els = $container.children().not(':empty'); | |
els.each(function() { | |
var $imgWrapper = $('.lp-pom-image-container', this); | |
var $img = $('img', this); | |
fs.set($imgWrapper); | |
fs.set($img); | |
}); | |
fs.set($container); | |
} | |
fs.preinit(); | |
fs.reinit(); | |
$(window).on('resize', function(e) { | |
fs.reinit(); | |
}); | |
} | |
setFullScreen(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment