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

  • Home
  • SEARCH
  • 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 8705915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:28:59+00:00 2026-06-13T03:28:59+00:00

I may be going about this the wrong way so if it’s bad practice

  • 0

I may be going about this the wrong way so if it’s bad practice please say so.

I have DIVs that contains a checkbox and label. The DIVs are styled to look like a button and I have written code so that if a user clicks (or taps) the DIV the value or state of the checkbox will toggle between checked and unchecked (this isn’t included in the code below).

Here’s what the DIV HTML looks like…

<div class="funkyCheckBox">
<label for="inputName">Label Text</label>
<input type="checkbox"  name="inputName" id="inputID" />
</div>

Now when the user clicks or taps the DIV I also wish to change the appearance of the container DIV (the one with the .funkyCheckBox class) so it is visually obvious to the user that the checkbox state has changed. I use jQuery toggle to add an active state to the DIV (the class funkyCheckBoxActive is added or removed to the DIV).

Here is the CSS…

.funkyCheckBox{
    display:block;
    border-radius: 1em 1em 1em 1em;
    margin-bottom:.5em;
    background: #ffffff; /* Old browsers */
    background: -moz-linear-gradient(top,  #ffffff 0%, #eaeaea 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#eaeaea)); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top,  #ffffff 0%,#eaeaea 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top,  #ffffff 0%,#eaeaea 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(top,  #ffffff 0%,#eaeaea 100%); /* IE10+ */
    background: linear-gradient(to bottom,  #ffffff 0%,#eaeaea 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eaeaea',GradientType=0 ); /* IE6-9 */
    padding:.5em;
    }

    .funkyCheckBoxActive{
    background: blue; 
    -webkit-transition: background-color 1000ms linear;
    -moz-transition: background-color 1000ms linear;
    -o-transition: background-color 1000ms linear;
    -ms-transition: background-color 1000ms linear;
    transition: background-color 1000ms linear;
    }

here is my edited jQuery code…

$(".funkyCheckBox").live("click, tap", function(){
    $(this).toggleClass("funkyCheckBoxActive");

});

When the user clicks one of the .funkyCheckBox Divs the new class is added with a nice CSS transition. When I click again the .funkyCheckBoxActive class is removed but I’d like there to be a similar transition when the class is removed rather than just an instant removal. What is the best way to go about this. I thought about adding a similar transition to the .funkyCheckBox class but I know this won’t work or give the desired effect. Any ideas, anyone?

If I haven’t explained my issue well please say so and I shall reword.

  • 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-13T03:29:00+00:00Added an answer on June 13, 2026 at 3:29 am

    you have used CSS3 transitions for your active class but the original funkyCheckBox has simple background gradients. Use css transitions in the funkyCheckBox class instead of background gradient for similar effect.

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

Sidebar

Related Questions

I may be going about this the wrong way. I have a container of
I'm wondering if I may be going about this the wrong way and am
I may be going about this in the completely wrong way, but how do
I may be going about this the wrong way, so I'll set out the
I'm rather new to Codeigniter, so I may be going about this the wrong
I'm new to Python so I may be going about this completely wrong, but
I'm probably going about this all wrong, but hey. I am rendering a large
This may be super simple - but I'm struggling to spot what's going on.
This problem may be a little broad, but I'm going to go ahead and
I have an app that is downloading a zip file and then copying this

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.