[Rails-spinoffs] Re: $(el).show() not working when you use CSS to hide elements

2008-03-10 Thread T.J. Crowder

http://www.prototypejs.org/api/element/show

Sadly, doesn't look like there's much you can do.
--
T.J. Crowder
tj / crowder software / com

On Mar 10, 6:08 am, Michael Sharman [EMAIL PROTECTED] wrote:
 Hi guys,

 If I hide an element using CSS (display:none;) it seems I cannot show
 the element using either;

  - $('myEl').show();
  - $('myEl').addClassName('showElement');

 Where the CSS class 'showElement' is basically display:block;

 Does anyone know a way around this? It works if I add the CSS inline
 like:

 div id=myEl style=display:none;

 But I'd rather not have that cluttering my markup.

 Thanks in advance,

 Michael
--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~--~~~~--~~--~--~---



[Rails-spinoffs] Re: $(el).show() not working when you use CSS to hide elements

2008-03-10 Thread Jarkko Laine

On Mon, Mar 10, 2008 at 11:59 AM, T.J. Crowder [EMAIL PROTECTED] wrote:

  http://www.prototypejs.org/api/element/show

  Sadly, doesn't look like there's much you can do.

Explanation here:
http://tobielangel.com/2006/12/31/why-the-css-display-property-sucks

//jarkko

--
Jarkko Laine
http://jlaine.net
http://odesign.fi

--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~--~~~~--~~--~--~---



[Rails-spinoffs] Re: $(el).show() not working when you use CSS to hide elements

2008-03-10 Thread Walter Lee Davis

What I've taken to doing is using a classname like 'initially_hidden'  
or something much shorter, and then taking advantage of the new  
document.observe wonderfulness to hide everything at dom:loaded.

document.observe('dom:loaded',function(){
$$('.initially_hidden').invoke('hide');
});

This has the further practical advantage of not hiding things in a  
permanent way from the unscripted.

Walter

On Mar 10, 2008, at 10:40 AM, Jarkko Laine wrote:


 On Mon, Mar 10, 2008 at 11:59 AM, T.J. Crowder  
 [EMAIL PROTECTED] wrote:

  http://www.prototypejs.org/api/element/show

  Sadly, doesn't look like there's much you can do.

 Explanation here:
 http://tobielangel.com/2006/12/31/why-the-css-display-property-sucks

 //jarkko

 --
 Jarkko Laine
 http://jlaine.net
 http://odesign.fi

 


--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~--~~~~--~~--~--~---