Skip to content

Instantly share code, notes, and snippets.

@Nolski
Last active April 19, 2017 03:25
Show Gist options
  • Save Nolski/b4a901aad1cb0fa7682e57ff3042862b to your computer and use it in GitHub Desktop.
Save Nolski/b4a901aad1cb0fa7682e57ff3042862b to your computer and use it in GitHub Desktop.
$('.circle').mouseover(
function() {
var sound = $(this).attr('class').split(' ')[2].replace('piano', 'sound'); // this is a monstrosity
sound.play();
}
);
$('.circle').mouseout(
function() {
var sound = $(this).attr('class').split(' ')[2].replace('piano', 'sound'); // this is a monstrosity
sound.pause();
sound.currentTime = 0;
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment