Vijayendra Achar
2007-Jan-29 14:51 UTC
how set background image inside <td > tag dynamically
how set background image inside <td > tag dynamically - plz help me -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Vijayendra Achar wrote:> how set background image inside <td > tag dynamically - plz help meStatically, it''s like style = "background-image:url(/images/wiki/skyRamp.png)" Dynamically, it might be page[''td_id''][''style''].backgroundImage = "url(...)" Someone should check my JavaScriptGenerator syntax, but that''s where I would start... -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Vijayendra Achar
2007-Jan-29 15:13 UTC
Re: how set background image inside <td > tag dynamically
Phlip wrote:> Vijayendra Achar wrote: > >> how set background image inside <td > tag dynamically - plz help me > > Statically, it''s like style = > "background-image:url(/images/wiki/skyRamp.png)" > > Dynamically, it might be page[''td_id''][''style''].backgroundImage = > "url(...)" > > Someone should check my JavaScriptGenerator syntax, but that''s where I > would start... > > -- > Phlip > http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!if i wanted to code this insdie <%= %> how to code -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Vijayendra Achar wrote:> if i wanted to code this insdie <%= %> how to codeOh, that kind of "dynamic"! Here''s my output: <td colspan="2" style="background-image:url(/images/wiki/skyRamp.png)"> (I built that with Builder::XmlMarkup, not ERb. Don''t try that until you learn more programming!) Now you can put the <%= %> anywhere in there that you like, replacing as much or as little of the source as you need, so long as ERb can read it and generate well-formed HTML. To vary just the image itself, try this: <td colspan="2" style="background-image:url(<%= get_my_image() %>)"> -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Vijayendra Achar
2007-Jan-29 16:28 UTC
Re: how set background image inside <td > tag dynamically
thanks but its not working Phlip wrote:> Vijayendra Achar wrote: > >> if i wanted to code this insdie <%= %> how to code > > Oh, that kind of "dynamic"! > > Here''s my output: > > <td colspan="2" style="background-image:url(/images/wiki/skyRamp.png)"> > > (I built that with Builder::XmlMarkup, not ERb. Don''t try that until > you learn more programming!) > > Now you can put the <%= %> anywhere in there that you like, replacing > as much or as little of the source as you need, so long as ERb can > read it and generate well-formed HTML. > > To vary just the image itself, try this: > > <td colspan="2" style="background-image:url(<%= get_my_image() %>)"> > > -- > Phlip > http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Vijayendra Achar wrote:> thanks > > but its not workingStart a new thread with a new subject line, and post your code here. -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---