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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:51:29+00:00 2026-06-15T21:51:29+00:00

In the following setup, why does the click event (and any other pointer event)

  • 0

In the following setup, why does the click event (and any other pointer event) not get fired?

If you remove the opacity: 0.5 line, it will work fine.

http://jsfiddle.net/523ve/

For posterity, in case jsFiddle ever goes down (December 21 is approaching):

HTML:

<div>
    <a>Click</a>
    <p>Paragraph</p>
</div>

CSS:

div { position: relative; margin: 40px; }
a { position: absolute; top: 0; right: 0; }
p { opacity: 0.5; }

JS:

$(document).ready(function(event) {
    $("a").click(function(event) {
        alert("Alert");
    });
});

(Tested in latest stable Chrome and Firefox)

  • 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-15T21:51:30+00:00Added an answer on June 15, 2026 at 9:51 pm

    “Since an element with opacity less than 1 is composited from a single offscreen image, content outside of it cannot be layered in
    z-order between pieces of content inside of it. For the same reason,
    implementations must create a new stacking context for any element
    with opacity less than 1. If an element with opacity less than 1 is
    not positioned, implementations must paint the layer it creates,
    within its parent stacking context, at the same stacking order that
    would be used if it were a positioned element with z-index: 0 and
    opacity: 1…”

    http://www.w3.org/TR/css3-color/#transparency


    EDIT:

    Also, your particular example has the <p> element overlapping the <a>.

    http://jsfiddle.net/523ve/4/

    So you could fix this by either moving the <a> so that it does not interfere, or by using z-index to re-adjust the stacking order. The latter option may have cross-browser issues but I have not tested. I recommend re-factoring your HTML so that these two elements do not overlap with each other.


    EDIT 2:

    Here is a related SO question, however the accepted answer is incorrect.

    What has bigger priority: opacity or z-index in browsers?

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

Sidebar

Related Questions

I have the following setup: Web.config has customErrors mode=Off Global.Application_Error() event calls a custom
I am following a tutorial but it does not say how to configure your
I have the following setup: So you can click on the search icon for
I've been following these 2 tutorials to setup a list & click events: http://mfarhan133.wordpress.com/2010/10/14/list-view-tutorial-for-android/
I have the following setup: Table: Question QuestionId Table: QuestionTag QuestionId TagId Table: Tag
I'm having the following setup of jQuery UI tabs: $(function() { $('#tabs').tabs({ ajaxOptions: {
I'm running the following setup: - Windows 2008 web edition - IIS 7 -
I have the following setup, and I need to know how to persist state.
I'm using the following setup: public MySQLProcessWriter(Connection con) throws SQLException { String returnNames[] =
I have the following setup, and the empty view text doesn't show up... protected

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.