.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-/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?hl=en -~----------~----~----~----~------~----~------~--~---
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 <moca...-S7FoVGKkKTI@public.gmane.org> 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-/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?hl=en -~----------~----~----~----~------~----~------~--~---
Try: parseFloat($$(''.scrollbox_content'')[0].getStyle(''paddingLeft''), 10); -- kangax On Jul 6, 12:55 am, mocambo <moca...-S7FoVGKkKTI@public.gmane.org> 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 <moca...-S7FoVGKkKTI@public.gmane.org> 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-/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?hl=en -~----------~----~----~----~------~----~------~--~---
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 <kan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Try: > > parseFloat($$(''.scrollbox_content'')[0].getStyle(''paddingLeft''), 10); > > -- kangax > > On Jul 6, 12:55 am, mocambo <moca...-S7FoVGKkKTI@public.gmane.org> 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 <moca...-S7FoVGKkKTI@public.gmane.org> 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-/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?hl=en -~----------~----~----~----~------~----~------~--~---
Kangax, you were right ... getStyle returns values for ''paddingTop'', ''paddingRight'', ''paddingLeft'', ''paddingBottom''. On Jul 6, 10:42 pm, mocambo <moca...-S7FoVGKkKTI@public.gmane.org> wrote:> 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 <kan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Try: > > > parseFloat($$(''.scrollbox_content'')[0].getStyle(''paddingLeft''), 10); > > > -- kangax > > > On Jul 6, 12:55 am, mocambo <moca...-S7FoVGKkKTI@public.gmane.org> 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 <moca...-S7FoVGKkKTI@public.gmane.org> 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-/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?hl=en -~----------~----~----~----~------~----~------~--~---