var bg = 'background: url(' + someVariable + ') no-repeat;';
$(element).setStyle(bg);

that should do the trick.

On Jan 3, 2:27 pm, yash <[EMAIL PROTECTED]> wrote:
> $(element).setStyle({
>   background: 'url(/image.gif) no-repeat'       /* Myproblem:
> background: 'someVariable' */
>
> });
>
> The above code snippet assigns the value 'url(image.gif) no-repeat' to
> the property 'background'. I have a situation where in i am getting
> the value i.e image URL from the back-end dynamically and i am able to
> store it in a variable say 'someVariable'. Now what is the syntax I
> should follow to assign 'someVariable' to background. Please help.
--~--~---------~--~----~------------~-------~--~----~
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