Skip to main content

Bug Tracker

Side navigation

#7965 closed bug (invalid)

Opened January 13, 2011 10:14PM UTC

Closed January 14, 2011 11:29PM UTC

Last modified January 24, 2011 01:21PM UTC

CSS Image-Background Hover not working in Chrome

Reported by: robertnealan@gmail.com Owned by:
Priority: low Milestone: 1.next
Component: css Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

When an anchor tag has a image background applied to it, attempting to swap it for another image on mouse hover results in no background when there's an underscore in a transparent png file (ex: ../images/fade_hover.png) in Google Chrome (Build 8.0.552.231). Removing the underscore from the file name resolves the issue.

$('a.toggle').hover(

function() { $(this).css("background-image", "url(../images/fade_hover.png)"); },

function() { $(this).css("background-image", "url(../images/fade.png)"); }

);

Attachments (0)
Change History (3)

Changed January 13, 2011 10:26PM UTC by anonymous comment:1

Scratch that last. Turns out it's an issue with the url path. Attempting to do a ../ to go up one folder is causing the problem, while putting in the full image url resolves the issue.

Changed January 14, 2011 11:29PM UTC by jitter comment:2

component: unfiledcss
priority: undecidedlow
resolution: → invalid
status: newclosed

Replying to [comment:1 anonymous]:

Scratch that last. Turns out it's an issue with the url path. Attempting to do a ../ to go up one folder is causing the problem, while putting in the full image url resolves the issue.

I assume you are the same person as the original reporter and that you request this ticket to be closed as it wasn't a jQuery bug.

If you didn't want this ticket to get closed please report back and demand the reopening of this ticket and also provide a reduced test case, which reproduces the issue you are experiencing, on http://jsfiddle.net. So that we can investigate this issue further.


How to report bugs

Changed January 24, 2011 01:21PM UTC by pieter@piet.nl comment:3

I forgot to add a final ) in the url path "url(../images/fade.png)", which causes the image to show in most browsers except for Chrome. Just adding ) at the end of the path did the trick for me.