Last active
December 15, 2015 06:39
-
-
Save djs070/5217630 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Check whether to do tricky layout | |
var classesForTrickyLayout = ['node-type-design', 'page-node-enquire', 'page-node-19', 'page-node-20', 'page-user']; | |
// Check against body classes | |
var doTrickyLayout = ( $( $('body').attr('class').split(/\s+/) ).filter(classesForTrickyLayout).length > 0 ); | |
if ( doTrickyLayout ) { | |
$('.fullscreen-background').appendTo($('#content-outer')); | |
// Resize image | |
var newWidth = $('#content-outer').width() - $('#content-inner').width(); | |
$(el).width(newWidth); | |
// Vertical center | |
var heightDifference = $('#content-outer').height() - $(el).height(); | |
$(el).css('top', Math.min(heightDifference / 2, 0)); | |
// Resize content area (has max and min height set in styles.css) | |
$('#content-wrapper').height($(el).height() - 60); | |
// Reinit scroll pane | |
$('#content-wrapper').jScrollPane(); | |
} else { | |
// Regular fixed fullsize background | |
$(this).expandTo($body); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment