Last active
December 21, 2015 00:39
-
-
Save jakecraige/6222314 to your computer and use it in GitHub Desktop.
Set backstretch image of page from image content type in drupal, and change css on scroll down
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 commercial_backstretch_setup() { | |
if($('.node-type-commercial-development').length > 0) { | |
var image = $('#content .field-image img').attr('src'); | |
$('body').backstretch(image); | |
var height = $(window).scrollTop() - $('#testimonial_wrapper').offset().top | |
if(height > $('#content').height()) { | |
$('#content').height(height * -1); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First if statement was used to prevent it from happening on a specific page