Last active
August 29, 2015 14:01
-
-
Save robspangler/683c521f0ff3b3f2fa0a to your computer and use it in GitHub Desktop.
Use jQuery Backstretch.js inline rather than housed in a script in <head>.
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
<!--In the HTML you would just need something like:--> | |
<section data-backstretch-url="images/featured-about.jpg"> | |
... | |
</section> |
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
$('*[data-backstretch-url]').each(function(){ | |
if ( $(this).data('backstretch-url') ) { | |
$(this).backstretch( $(this).data('backstretch-url') ); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment