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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:27:23+00:00 2026-06-06T05:27:23+00:00

So I am trying to get a border around buttons on my page when

  • 0

So I am trying to get a border around buttons on my page when the user clicks them.

To set up the handler I am going:

$(".reportButtons").click(function(){ //change border color });

I have tried 2 ways to change the border color of the buttons in there. The first way is using the .css() function.

$(this).css({"border-color": "#C1E0FF", 
             "border-weight":"1px", 
             "border-style":"solid"});

But when I do it this way, the border is really fat (I want it to be hairline, like it normally would be if I set the width to 1px)

The other way I have tried is by downloading the jquery-color plugin, and doing something like:

$(this).animate({borderTopColor: "#000000"}, "fast");

When I do that, nothing happens. There is no error – just nothing happens. But if instead of trying to change the border color, I try to change the background color, it works fine….so am I using the jquery-color wrong? For reference, here is how I would change the background:

$(this).animate({ backgroundColor: "#f6f6f6" }, 'fast');

like I said, that works. When I downloaded jquery-color, I only downloaded the one file (jquery-color.js), if that makes a difference….

So how do I go about getting a hairline border? (I would prefer to use the animate() method if you have anyideas how to get that to work)

  • 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-06-06T05:27:24+00:00Added an answer on June 6, 2026 at 5:27 am

    Current Example:

    You need to define border-width:1px

    Your code should read:

    $(this).css({"border-color": "#C1E0FF", 
                 "border-width":"1px", 
                 "border-style":"solid"});
    

    Suggested Example:

    You should ideally use a class and addClass/removeClass

    $(this).addClass('borderClass');
    $(this).removeClass('borderClass');

    and in your CSS:

    .borderClass{
      border-color: #C1E0FF;
      border-width:1px;
      border-style: solid;
      /** OR USE INLINE
      border: 1px solid #C1E0FF;
      **/
    }
    

    jsfiddle working example: http://jsfiddle.net/gorelative/tVbvF/\

    jsfiddle with animate: http://jsfiddle.net/gorelative/j9Xxa/
    This just gives you an example of how it could work, you should get the idea.. There are better ways of doing this most likely.. like using a toggle()

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

Sidebar

Related Questions

I'm trying to get a garish red border around some radio buttons, but it
I'm trying to get phpExcel to draw a border around a bunch of cells.
I'm trying to set a border around some districts in the UK, similar to
I'm playing around with display properties trying to get the hang of them. One
I'm currently trying to get my head around arrays and how to utilise them
I'm trying to find a way to get rid of the border around the
I'm trying to get this blue border (which is around a NSTextFieldCell when you
I am trying get all html links within a string and replace them using
I am trying get all html links within a string and replace them using
Trying to get my mind around google protobuf. I found some implementation of protobuf

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.