Skip to content

Instantly share code, notes, and snippets.

@srobbin
Last active March 25, 2018 13:01
Show Gist options
  • Save srobbin/1978737 to your computer and use it in GitHub Desktop.
Save srobbin/1978737 to your computer and use it in GitHub Desktop.
Backstretch Demo: Button Click
/*
* You can easily attach Backstretch to jQuery events, like click
*
* Click the buttons above to see the background image change
*/
$("#outside").click(function(e) {
e.preventDefault();
$.backstretch('images/outside.jpg');
});
$("#cheers").click(function(e) {
e.preventDefault();
$.backstretch('images/cheers.jpg');
});
@Momojel
Copy link

Momojel commented Feb 6, 2013

Hi guys,

I would like to know if it would be possible to use this code with "Hover" instead of "Click" please. I am novice to jquery.

Thank you very much for ur help !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment