$('selector').click(function (index) {
$('another').eq(i) //do something
});
but not working.And this way it works
$('selector').click(function(){ var a = $('selector').index(this) );
$('another').eq(a) //do something
});
Extend learning
select all element except the clicked one
it is important that .not() writing at the above.$('selector').click(function(){ var a = $('selector').index(this) );
$('another').not(this) //do something
$('another').eq(a) //do something});
沒有留言:
張貼留言