Skip to content

Instantly share code, notes, and snippets.

@jbutko
Created April 14, 2014 16:29
Show Gist options
  • Save jbutko/10663225 to your computer and use it in GitHub Desktop.
Save jbutko/10663225 to your computer and use it in GitHub Desktop.
jQuery: Get index of hovered element
$(document).ready(function () {
$('.around li').hover(function () {
var index = $('.around li').index(this);
console.log(index);
}, function () { });
});
// From http://stackoverflow.com/questions/11294012/jquery-get-index-of-hovered-li
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment