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 6962761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:42:07+00:00 2026-05-27T15:42:07+00:00

I need to respond to a hover over a table cell. This css code

  • 0

I need to respond to a hover over a table cell. This css code works fine:

#dialog-date-picker td { 
  border-style: outset !important;
  border : 2px solid #606060;
  cursor: pointer;
  ...etc
}

#dialog-date-picker td:hover {
  border-style: inset !important;
  border : 2px solid #6060b0;
}

However, I need a more complex hover response that I can’t get in css, and I’ve started as follows:

$('#dialog-date-picker td').hover(function () {
      $(this).css('border-style', 'inset !important');
      $(this).css('border', '2px solid #6060b0');
   }, function() { 
      $(this).css('border-style', 'outset !important');
      $(this).css('border', '2px solid #606060');
   }
);

The jQuery equivalent works in Chrome and Opera, but not FF. Firebug shows that the code is executed, but nothing happens. Any ideas why this should be? Thanks.

EDIT

Folks – I understand that this isn’t elegant, and I should be using css and JS, and adding a class, but that’s not the issue. I just took a working css solution and, as a first step, just put it in the JS above. At that point I found out that the JS equivalent worked in Opera and Chrome, but not FF. Combining the two css calls, and converting ‘border-style’ to ‘borderStyle’, didn’t make a difference; it still doesn’t work in FF.
Is it relevant that the dialog (jQuery UI) is dynamic? I’ve got a table within the dialog. Thanks for all the input.

EDIT2

Simplified the code to:

$('#dialog-date-picker td').hover(
   function() { $(this).css('border', '2px inset  #6060b0 !important'); },
   function() { $(this).css('border', '2px outset #606060 !important'); }
);

with no change (works in IE8, Opera, Chrome, Safari, but not FF 3.6 or 8.0).

EDIT3

Ok, given up on this. All the alternative (and better) stylesheet versions work in FF, so it seems a bit pointless worrying about why this particular code doesn’t work in FF…

  • 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-27T15:42:08+00:00Added an answer on May 27, 2026 at 3:42 pm

    The problem is because the second css() call is overwriting the first. Try this:

    $('#dialog-date-picker td').hover(
        function () {
            $(this).css({
                'border-style': 'inset !important',
                'border': '2px solid #6060b0'
            });
        }, 
        function() { 
            $(this).css({
                'border-style': 'outset !important',
                'border': '2px solid #606060'
            });
        }
    );
    

    Example fiddle

    EDIT

    Here’s an extra fiddle thanks to PPvG and ptriek with a much more elegant solution which uses classes and solves the issue of setting an outset border, then immediately making it solid.

    Updated Fiddle

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

Sidebar

Related Questions

I'm working on a MFC C++ dialog where I need to respond to right
I need my code to respond to the event when my system finds new
Setup: I have two views that I need to respond to the touch event,
I need to respond to the events of minimizing / maximizing Eclipse window. How
Some of my controller actions need to respond with different ViewResults depending whether or
I need to know how to test this controller action def create_mobile if mobile_user
I need to create an interactive Facebook Tab for a client, similar to this:
Upon receiving a UDP packet, I need to respond to the sender with the
basicly i need my page to respond to left and right arrow keys. so
Given a JSON respond to a form I need to parse through the JSON

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.