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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:06:32+00:00 2026-05-31T07:06:32+00:00

Context I’ve this buttons: I detect when the user is clicking with jQuery .click()

  • 0

Context

I’ve this buttons:

enter image description here

I detect when the user is clicking with jQuery .click().

But it works only if the user clicks on the text ("imdb" / "rottenTomatoes").

If the user clicks on the blue of button, jQuery detects nothing.

enter image description here

You can try on http://promobluray.fr.

Questions

  • What is the problem?
  • How to get this to work like a button?

Code

html:

<span class="rating">  
    <span class="rating-btn imdb active">imdb</span>
    <span class="rating-btn rt">rottenTomatoes</span>
</span>​

css:

.rating {
    padding: 14px;
}

.rating-btn {
    display: inline-block;
    margin-top: 24px;
    padding: 4px;
    position: relative;
    font-family: 'Open Sans',sans-serif;
    font-size: 12px;
    text-decoration: none;
    color: white;
    cursor: pointer;
    background-image: -o-linear-gradient(bottom,#2CA0CA 0,#08C 100%);
    background-image: -moz-linear-gradient(bottom,#2CA0CA 0,#08C 100%);
    background-image: -webkit-linear-gradient(bottom,#2CA0CA 0,#08C 100%);
    background-image: -ms-linear-gradient(bottom,#2CA0CA 0,#08C 100%);
    background-image: linear-gradient(bottom,#2CA0CA 0,#08C 100%);
    -webkit-box-shadow: inset 0 1px 0 #7fd2f1,0px 6px 0 #156785;
    -moz-box-shadow: inset 0 1px 0 #7fd2f1,0px 6px 0 #156785;
    box-shadow: inset 0 1px 0 #7fd2f1,0px 6px 0 #156785;
    border-radius: 5px;
}

.rating-btn::before {
    background-color: #072239;
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    padding-left: 2px;
    padding-right: 2px;
    padding-bottom: 4px;
    left: -2px;
    top: 5px;
    z-index: -1;
    border-radius: 6px;
   -webkit-box-shadow: 0 1px 0 #fff;
   -moz-box-shadow: 0 1px 0 #fff;
   box-shadow: 0 1px 0 #fff;
}

.active {
    background: #2CA0CA;
    -webkit-box-shadow: inset 0 1px 0 #7fd2f1,inset 0 -1px 0 #156785;
    -moz-box-shadow: inset 0 1px 0 #7fd2f1,inset 0 -1px 0 #156785;
    box-shadow: inset 0 1px 0 #7fd2f1,inset 0 -1px 0 #156785;
    top: 7px;
    cursor: default;
}

.imdb {
    margin-right: 5px;
}

jquery:

$('.rating-btn').click(function() { ... });

​

  • 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-31T07:06:34+00:00Added an answer on May 31, 2026 at 7:06 am

    You could try to increase the padding of the button so that the <span> matches the dimension of the image, but i think that the best solution is to change your markup and actually use <button>

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

Sidebar

Related Questions

Context: There's an application where you draw things on canvas. Where user clicks there's
Context I want to display Twitter and Facebook buttons on my new site. But
Context: .NET 3.5, VS2008. I'm not sure about the title of this question, so
Context: We are building a framework for rapid delivery of WPF applications. This framework
Context: HTML widgets generated using a Django ModelForm and template, jQuery 1.3.2, JavaScript on
Context I use jQuery UI autocomplete with a remote datasource. The source send data
context.Response.ContentType = text/plain; context.Response.Write(returnString); If returnString is NULL what will it pass, or will
Context is important for this question . So context first. I learned Symfony 3
Context This is a question mainly about Lucene (or possibly Solr) internals. The main
Context We have this application, using about 60 coding projects. We have several products

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.