Nicolas Terray
2006-Sep-15 15:26 UTC
Re: Quick way to remove "display:none" for non-javascript ?
On 9/15/06, Leon Chevalier <leon-/gNFX0pVsuRWk0Htik3J/w@public.gmane.org> wrote:> The content part of my site fades in at certain points. To achieve this I > need an inline "display:none". > > <div id="content" style="display:none"> > Content! > </div> >What about to add display:none to your elements through javascript ? Nicolas --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve aka TDD
2006-Sep-15 15:30 UTC
Re: Quick way to remove "display:none" for non-javascript ?
Out of my hat: Maybe bind to DOMContentLoaded to add the inline style by JS, something like: $(''id'').style.display = ''none''; ?! -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Leon Chevalier
2006-Sep-15 16:21 UTC
Quick way to remove "display:none" for non-javascript ?
Hi all, The content part of my site fades in at certain points. To achieve this I need an inline "display:none". <div id="content" style="display:none"> Content! </div> All great. However, when looking at it with JavaScript turned off, no content. I know I could put in a <noscript>Turn it on!</noscript> as per the scriptaculous homepage, but the site is fine without JavaScript. I just need it to display. So, before I work on a redirect-based JavaScript detect system, does anyone have a clever way of getting around this problem? Cheers, Leon --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Leon Chevalier
2006-Sep-16 12:07 UTC
Re: Quick way to remove "display:none" for non-javascript ?
-----Original Message----- Out of my hat: Maybe bind to DOMContentLoaded to add the inline style by JS, something like: $(''id'').style.display = ''none''; ------------------- Unfortunately it doesn''t take effect fast enough for IE, even using DOMContentLoaded, producing a small flicker as the div loads, hides, then fades in again. Thanks, Leon --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2006-Sep-16 12:17 UTC
Re: Quick way to remove "display:none" for non-javascript ?
Leon Chevalier a écrit :> Unfortunately it doesn''t take effect fast enough for IE, even using > DOMContentLoaded, producing a small flicker as the div loads, hides, then > fades in again.OK, out of my hat again, how about this: - In your <head>, use a small inline script that writes a <link> on a CSS defining a display: none class, used by your elements. Without JS, you''ll end up with elements using an undefined class, thereby being visible from the start. - On DOMContentLoad (or even regular load), update all those elements with inline "display:none" through their style property, then use DOM Level 2 Style to alter the CSS definition to remove the class-level "display: none" (thereby allowing hide(), show(), etc. to work properly). I''m not 100% sure the latter CSS manipulation is feasible, but I believe it is. Of course, this is kinda convoluted :-/ -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---