Re: [jQuery] Change opacity of item with class of selected

2010-01-05 Thread Paul Collins
Sorry, the test page: http://paulcollinslondon.com/test/test.html 2010/1/5 Paul Collins > Thanks very much for your help Brian. That works, but I think the problem > may go deeper than I thought! I've put up a test page. > > I'm using the "JQuery Opacity Rollover" Script as a part of the Galleri

Re: [jQuery] Change opacity of item with class of selected

2010-01-05 Thread Paul Collins
Thanks very much for your help Brian. That works, but I think the problem may go deeper than I thought! I've put up a test page. I'm using the "JQuery Opacity Rollover" Script as a part of the Gallerific plugin http://www.twospy.com/galleriffic/#1 To try and keep this simple, when you hover over

Re: [jQuery] Change opacity of item with class of selected

2010-01-05 Thread brian
Just put the class in the selector instead of testing for it first: $("#portfolio #thumbs li.selected").css('opacity','0.5'); If the class doesn't exist, jQuery will do nothing (instead of throwing an "undefined" error or similar). On Tue, Jan 5, 2010 at 12:45 PM, Paul Collins wrote: > Hi all >

[jQuery] Change opacity of item with class of selected

2010-01-05 Thread Paul Collins
Hi all I've been stuck on this for four hours, and I still can't solve it! I am trying to check if a list item has a class of selected, then is so change the opacity to 0.5. Here is my code: if ($("#portfolio #thumbs ul li").hasClass(".selected")) { $(this).css('opacity','0.5');