1-) Check the sintax for
$('#photo'+photo['id']+'') have a closest look on single and double quotes.
2-) If photo['id'] is the form photo239839
then
$('#photo'+photo['id']+'') is equal to #photophoto239839
Try $("#" + photo['id'])
MaurĂcio
-----Mensagem Original-----
De: "adam" <abreck...@gmail.com>
Para: "jQuery (English)" <jquery-en@googlegroups.com>
Enviada em: quarta-feira, 24 de dezembro de 2008 20:17
Assunto: [jQuery] jQuery help
I'm trying to change the border color of an image using it's id with
jquery
( photo['id'] is passed in from a previous function )
the id's of the photos are of the form 'photo239839'
$('#photo'+photo['id']+'').click(function(){
$('#photo'+photo['id']+'').css('border-color','#777');
});
When i try to use this same code using it's class it works,
but i can't use this method since there are multiple images on the
same
page with the same class
$('img.flickr_photo').click(function(){
$("this.flickr_photo").css('border-color','#777');
});
Please help, i'm a bit of a jQuery newb.
Thanks!