Hi there,

hope I can explain this one! When I try to use a setStyle call and set
the backgroundImage property of an element, I'm having some problems
using a relative URL.

my directory structure is this:

SERVER_ROOT/context/javascript/tree.js
SERVER_ROOT/context/style/tree/tree.css
SERVER_ROOT/context/images/node_icons/open.png
SERVER_ROOT/context/images/node_icons/closed.png

in my tree.css file i set background image using the relative
url: ../../images/node_icons/open.png

this works fine. However in my tree.js file I use the prototype
setStyle call and use the following:

nodeIconSpan.setStyle({backgroundImage:'url(../images/node_icons/
1nodeopen.gif)'});

this doesn't work, it appears that the browser attempts to load from
SERVER_ROOT/images/node_icons/1nodeopen.gif

which is wrong (no 'context').

I thought that maybe the image should be relative to the original css
file but that doesn't work either. I can get it to work fine using an
absolute url but I'd really rather not do that.

Any ideas??

Many thanks.

Steven Shand


--~--~---------~--~----~------------~-------~--~----~
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