Let's see who's got the best cross-browser chops!

Here's my problem:


#OBJECTIVE : change the background image of a div and have it work in IE
6/7 and the real browsers.

#HTML:

<div id="my-div"
style="background:url('http://www.foo.com/image_one.png'">
...
</div>

At this point, my background image (image_one.png) is visable in all
three broswers. Upon an AJAX request, I'd like to update the background
to 'image_two.png'.  To accomplish this, I use RJS.

#RJS:

page['my-div'].setStyle(:background=>url('http://www.foo.com/image_two.png')
")

#RESULTS:
This works in firefox, but not in IE (v6, SP2), or Safari.


#QUESTIONS:

1. Is my RJS technique correct?  Is there a more idiomatic/correct
technique?
2. The seems like this a rather common programming objective, and there
should be a straight-forward solution.  Are other people doing this?
3. My cross-brower knowledge is not that great, but I'd love to find a
good discussion of this topic, if someone knows of one.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Deploying Rails" group.
To post to this group, send email to rubyonrails-deployment@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-deployment?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to