Skip to content

Instantly share code, notes, and snippets.

@robspangler
Last active August 29, 2015 14:01
Show Gist options
  • Save robspangler/683c521f0ff3b3f2fa0a to your computer and use it in GitHub Desktop.
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>.
<!--In the HTML you would just need something like:-->
<section data-backstretch-url="images/featured-about.jpg">
...
</section>
$('*[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