Hi Paul.

Use each() to catch the image index.

$('td img').each(function(i) {
var indexHover = 'i'
 $(this).hover(function(){
 $('td img').eq(i-1).animate({
 width: "50px",
 height: "50px" }, 500 ),
    function () {
  }
 });
});

MaurĂ­cio



-----Mensagem Original----- De: "paul" <palkl...@gmail.com>
Para: "jQuery (English)" <jquery-en@googlegroups.com>
Enviada em: domingo, 18 de janeiro de 2009 21:21
Assunto: [jQuery] calculating eq from index




hi,
i have some images in a table.
could the following be in the right direction of accessing the
surrounding images of the one that gets
hovered?

$('.someclassname').hover(function(){
$('#somediv img:eq( (index(this))-1) ).animate({ width: "50px",
height: "50px" }, 500 );
},
 function () {
});



Reply via email to