Thanks a lot. Always a pleasure to learn from people like you in this group.
bye Enric On Sep 3, 3:48 am, Sanford Whiteman <[email protected]> wrote: > > I only want to style the first letter of paragraphs having a certain > > class, but if I add this class widh the .addClass() function nothing > > happens initialy in Firefox but it is rendered well in Chrome. If I > > try to edit the html of the paragraph with firebug then the ::first- > > letter selector works. > > Gotta force reflow: > > $('another').addClass('deco').setStyle('overflow','hidden'); > > works in this case. > > There is no single, cross-browser, non-disruptive way to force CSS to > be refreshed. Resetting overflow to a safe value happens to work for > your layout; other times you can do a no-op like > el.setStyle('height',el.getStyle('height')) or even just a > getStyle('offsetHeight'). But sometimes you may need to toggle > display:none » display:block to get it to take -- and in those cases > probably better to find a way to do the restyling without fancy > pseudos or with element styles only. > > -- S.
