Bug Tracker

Modify

Ticket #7965 (closed bug: invalid)

Opened 2 years ago

Last modified 2 years ago

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:
Blocking: Blocked by:

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

comment:1 follow-up: ↓ 2 Changed 2 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 2 years ago by jitter

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to css

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 2 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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.