Skip to content

Instantly share code, notes, and snippets.

@hristiank
Created March 23, 2017 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hristiank/f2a315d406aa1ff47e1a7bbc85c56dc1 to your computer and use it in GitHub Desktop.
Save hristiank/f2a315d406aa1ff47e1a7bbc85c56dc1 to your computer and use it in GitHub Desktop.
Full Width Sliding Images
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