Element.getstyle() reads element style values. And the current values
are:

$$('.scrollbox_content')[0].style.padding = "";
$$('.scrollbox_content')[0].style.paddingLeft = "";
$$('.scrollbox_content')[0].style.paddingTop = "";
$$('.scrollbox_content')[0].style.paddingBottom = "";
$$('.scrollbox_content')[0].style.paddingRight = "";

But browser shows 5px padding anyway. How to get these paddings ?

On Jul 6, 7:36 pm, kangax <[EMAIL PROTECTED]> wrote:
> Try:
>
> parseFloat($$('.scrollbox_content')[0].getStyle('paddingLeft'), 10);
>
> -- kangax
>
> On Jul 6, 12:55 am, mocambo <[EMAIL PROTECTED]> wrote:
>
> > In my previous message was an typo, so my question once again:
>
> > .css file contains:
>
> > .scrollbox_content {
> >         padding: 5px
>
> > }
>
> > .js contains:
>
> > var content_div = document.createElement('div');
> > content_div.addClassName('scrollbox_content');
> > element.insert(content_div);
>
> > This "padding" is now visible but
>
> > $$('.scrollbox_content')[0].getStyle('padding')
>
> > gives "".
>
> > On Jul 6, 7:52 am, mocambo <[EMAIL PROTECTED]> wrote:
>
> > > .css file contains:
>
> > > .scrollbox_content {
> > >         padding: 5px
>
> > > }
>
> > > .js contains:
>
> > > var content_div = document.createElement('div');
> > > content_div.addClassName('scrollbox_content');
> > > element.insert(this.content_div);
>
> > > This "padding" is now visible but
>
> > > $$('.scrollbox_content')[0].getStyle('padding')
>
> > > gives "".
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to