You always need to specify the unit of something you set... be it
'px', '%' or even 'pt'...

On 26 nov, 14:28, Roland <[EMAIL PROTECTED]> wrote:
> setStyle({height:myVariable + 'px'})
>
> that should do it...
>
> On 26 nov, 14:13, polomasta <[EMAIL PROTECTED]> wrote:
>
> > I get "number 887" which seems correct. So i need to take that number
> > and use setStyle to set the height of a div.
>
> > On Nov 20, 2:13 pm, Roland <[EMAIL PROTECTED]> wrote:
>
> > > What does alert(typeof myVariable + '  ' + myVariable); say?
>
> > > On 20 nov, 20:14,polomasta<[EMAIL PROTECTED]> wrote:
>
> > > > I am trying to use the setStyle function to dynamically change the
> > > > height of an element. Depending on the content of the page, the height
> > > > of the element needs to change so I am trying to pass a variable in to
> > > > setStyle like so:
>
> > > > $(backgroundContainer).setStyle({ height: myVariable });
>
> > > > I keep getting "Error in parsing value for property 'height'.
> > > > Declaration dropped"
>
> > > > Can anyone offer me some guidance? Thanks!!
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
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