yes, but you can have a hold Division and add the CSS. I dont mind an extra division to avoid using scripts to do the CSS for me.
On Dec 7, 8:58 am, Dhruva Sagar <dhruva.sa...@gmail.com> wrote: > @Nivanka but that presents a problem that I need to know the child elements > of .work before hand. > If the DOM is dynamic, it might not be that simple. But I still agree that > your approach is better in the given context. > > Thanks & Regards, > Dhruva Sagar. > > On Mon, Dec 7, 2009 at 9:21 AM, Nivanka <fonseka...@gmail.com> wrote: > > Rather than setting the opacity from a javascript I prefer if you can > > do it in your CSS. > > > .work div{ > > opacity: 1 !important; > > } > > > This is better as it doesnt go through the DOM to set the opacity. to > > save memory, time of execution etc. > > > On Dec 7, 8:26 am, Dhruva Sagar <dhruva.sa...@gmail.com> wrote: > > > What Greg has mentioned is absolutely true. > > > But I think the better / easier approach to solve this issue must be > > > something like this : > > > > $(document).ready(function(){ > > > $('.work').css('opacity', '0.6').children().css('opacity', '1'); > > > //I am actually not very sure about the above code, if that > > doesn't > > > work this should : > > > $('.work').css('opacity', 0.6').children().each(function(){ > > > $(this).css('opacity', '1'); }); > > > > } > > > > Thanks & Regards, > > > Dhruva Sagar. > > > > On Mon, Dec 7, 2009 at 8:50 AM, Greg Tarnoff <greg.tarn...@gmail.com> > > wrote: > > > > > The problem is in the way browsers render opacity. The spec reads that > > > > only the element and not children should have the reduced opacity, > > > > however none of the browsers have implemented this at last check > > > > (maybe safari 4+). > > > > > Your best bet is to apply a background image with the designated > > > > opacity as a PNG. This will keep everything at 100% opacity but still > > > > resemble the look you are after. > > > > > Another option is to not have .work wrap the other objects and use > > > > relative positioning to move them in place. Then you use your current > > > > css but it doesn't affect the items you want because they aren't > > > > children of .work. > > > > On Dec 6, 9:00 pm, Many <martin.clav...@gmail.com> wrote: > > > > > Hey, > > > > > > <div class="work"> > > > > > <div class="title">DEMO</div> > > > > > <div class="logo"><img src="images/demo.jpg" /></div> > > > > > </div> > > > > > > I want to set opacity to ".work" , it works fine if i do > > $(".work").css > > > > > ("opacity","0.6"); but, i don't want the class title and logo have > > > > > this opacity, how can i fix it? > > > > > > Thanks for reading!!