I realize you found a solution, but you might want to look at this
plugin (I'll eventually get around to adding it to the jQuery plugin
repository):
http://scottsplayground.com/temp/jquery.ordinal.js
Also, something a lot of people aren't aware of is:
$(this).parent().children().index(this);
$('#' + self.options.auto_complete_id + ' li').bind( 'mouseover',
function() {
$this = this;
$(this).parent().children().each( function( i ) {
if ( $this == this ) {
alert( i + 1 );
}
});
});
On Feb 5, 8:15 am,
Hi Eridius,
I guess this could do it:
$('#' + self.options.auto_complete_id + ' li').each(function(i) {
// i is now an index
$(this).bind('mouseover', function() {
//do something on mouseover
});
});
--
Bohdan Ganicky
On Feb 5, 2:15 pm, Eridius [EMAIL PROTECTED] wrote:
untested but something like this should work using closure:
$('#' + self.options.auto_complete_id + ' li').each(function (i) {
$(this).bind('mouseover', function() {
if (i == 3) {
//code
}
});
});
David
Yea, i just thought about the .each thing about 15mins ago and it worked
perfect. Thanks for the replies.
Bohdan Ganicky wrote:
Hi Eridius,
I guess this could do it:
$('#' + self.options.auto_complete_id + ' li').each(function(i) {
// i is now an index
5 matches
Mail list logo