[jQuery] Re: same effect on multiple objects with same id

2009-06-09 Thread Armand Datema
Hi you cannot have multiple ids ids are unique you need to use a class name instead . img src=button.jpg alt=button border=0 id=myButton class=hoverbutton/ end loop So only this loops and i only need the code below once. $(document).ready(function(){ $(img.hoverbutton).hover( function ()

[jQuery] Re: same effect on multiple objects with same id

2009-06-09 Thread Mauricio (Maujor) Samy Silva
Why not use a class instead of an id in order to target all buttons? Or alternatively something like: $('img[alt=button]').hover( function () { $(this).fadeTo('fast', .10); }, function () { $(this).fadeTo('fast', 1.0); } ); Maurício -Mensagem

[jQuery] Re: same effect on multiple objects with same id

2009-06-09 Thread NickFitz
On Jun 9, 11:56 am, simon si...@uvfx.tv wrote: this works fine but gives me a lot of jquery code as well for each as i also have a click action after it, but thats another matter, what i am after is if i just give it the same id as below  then i would like only to have one hover code that

[jQuery] Re: same effect on multiple objects with same id

2009-06-09 Thread Exom
I hope this helps: script $(document).ready(function(){ $(#menubar *).mouseover(function () { $(this).fadeTo(slow, 0.33); }); $(#menubar *).mouseout(function () { $(this).fadeTo(slow, 1); }); }); /script

[jQuery] Re: same effect on multiple objects with same id

2009-06-09 Thread simon
thanks everyone, thats great to here from all the suggestions will give it a go. Much appreciated Si