Hey, I have the following function:
function getPosition() {
var cLeft = $('#element').position().left;
var cTop = $('#element').position().top;
}
I also have this:
$('ul#container>li.node:eq('+XXX+')').css({'border' : '5px solid yellow'});
Now, is it possible to determine what index for the LI’s is at the co-ordinates provided by getPosition() ?
Note: XXX denotes where I would like the index of the LI’s to be.
Here is some plain JavaScript
I’m not sure support for IE, but Firefox has had it since 3.
To start going crazy with jQuery, simply wrap it