Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#7965 closed bug (invalid)

CSS Image-Background Hover not working in Chrome

Reported by: robertnealan@… 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)"); }

);

Change History (3)

comment:1 Changed 9 years ago by 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.

comment:2 in reply to:  1 Changed 9 years ago by jitter

Component: unfiledcss
Priority: undecidedlow
Resolution: invalid
Status: newclosed

Replying to 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

comment:3 Changed 9 years ago by pieter@…

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.

Note: See TracTickets for help on using tickets.