This is likely due to relative path issues.
What is the path (i.e. the URL displayed in the browser navigation bar) for the page containing the code you posted? Where does this apply to the image catalog?
Managing this can be a bit of a nightmare, especially if you included the javascript file on several pages that are at different levels of the URL hierarchy.
The best way to handle this is to define the class in the css file, make the image URL relative to the location of the css file itself, and then simply apply the class to your div, instead of setting individual style attributes.
belugabob
source share