Use the parameter-less version of the .index() method to find the position of the element relative to its siblings:
$('.container').children('p').hover(function() {
var index = $(this).index() + 1;
});
Note that the result of .index()
will be zero-based, not one-based, hence the + 1