Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6009055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:54:58+00:00 2026-05-23T01:54:58+00:00

As usual I developed it in Firefox. Usually it works without modification in Chrome/Safari,

  • 0

As usual I developed it in Firefox. Usually it works without modification in Chrome/Safari, and also IE8.

But when I tested on Chrome and Safari, I was surprised to see that it does not work.

My CSS is valid (validated on w3c). The JavaScript (using jQuery) seems to be valid too.

The affected elements are not redrawn after an attribute value is modified through jQuery, so the CSS rules for the new attribute value are not applied, not until I go into the Chrome inspector and deselect/select them manually…

Update: I do not have a working link for this problem anymore.

The problem was that Webkit was not “redrawing” when attributes were changed, but only when classes where changed, so CSS blocks with selectors such as div[attr=value] would not apply when attribute attr was changed to value through JavaScript.

One workaround is to use classes instead of attributes (.className) in selectors. Performing a class change after changing an attribute would also trigger a redraw also fix the problem.

This post is more than 5 years old, I believe the problem has been fixed in Chrome now.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:54:58+00:00Added an answer on May 23, 2026 at 1:54 am

    The issues seems to come from the fact you are using attributes (selected attribute on DIVs) to control the state of your images; it seems like the webkit engine doesn’t update the graphics until something actually changes – like a class or a style property.

    In general, you should know that using a custom attribute like that isn’t best practice. You can use a class to indicate when it’s on, and .addClass("selected"),.removeClass("selected") when needed.
    Also, you can display the images as background image of an element and control it directly from CSS, with:

    .item div.caption { background-image: url('bras/B/btn.png'); }
    .item.selected div.caption { background-image: url('bras/B/btn_selected.png'); }
    

    this will simply change the image according to the div.item selected class.

    For a simple work-around, you could add at the bottom of your .click handler something like $("body").toggleClass("somethingrandom");, but I really recommend to change your code to work with CSS, background-images and classes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a usual MFC project developed in VC++ 2010 but since my client
As usual, when a tableviewcell is touched, it will be selected. But now i
I have an HTML interface developed using the usual suspects and I have a
I'm usually a LAMP developer, but some .NET work has arrived on my plate
See also related question: How do you debug Qt layout problems I've got some
I'm trying to draw a state machine for my developed software so as usual
With a Java background, but having never developed for the web client side (i.e.
I am an usual Java developer but now I'm trying to create some OpenGL
What is the most usual way to develop views in asp.net mvc? Should I
The usual way to resolve lnk involve using WShell.WshShortcut or IShellLink that way :

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.