Skip to content

Instantly share code, notes, and snippets.

@wallin
Forked from jacobk/script.js
Created April 12, 2011 21:11
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wallin/916420 to your computer and use it in GitHub Desktop.
Save wallin/916420 to your computer and use it in GitHub Desktop.
$(function() {
$('div.content').live('showoff:show', function(evt) {
var bg_img = $('img[alt=background]', evt.target);
var old_bg = '';
if (bg_img.size() > 0) {
var src = bg_img.attr('src');
bg_img.hide();
// Set new background on body
old_bg = $('body').css('background-image');
$('body')
.css('background-image', 'url(' + src + ')')
.addClass('fullScreen');
} else {
$('body').css('background-image', old_bg).removeClass('fullScreen');
}
});
});
body.fullScreen {
background-repeat: no-repeat;
background-position: center center;
background-attachment: fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
#preso, .slide {
border: none !important;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment