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

The Archive Base Latest Questions

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

Is is possible to detect a click in an absolute positioned div (in all

  • 0

Is is possible to detect a click in an absolute positioned div (in all its area) that is partially hidden in all the area of the div? In this case i would like to detect the click when user clicked in the hidden part of div-1. Thx

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#div-1').bind("click", function () { console.log('div 1 cliked');});
//$('#div-2').bind("click", function () { console.log('div 2 cliked');});
});
</script>
</head>
<body>
<div id="div-1" style="position:absolute; top:10px; left:500px; z-index:500; width:100px; height:100px; background-color:#9999FF; display:block;"></div>
<div id="div-2" style="position:absolute; top:10px; left:540px; z-index:500; width:100px; height:100px; background-color:#CC9999;"></div>
</body>
</html>
  • 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-31T03:06:39+00:00Added an answer on May 31, 2026 at 3:06 am

    The simple solution – pointer events: FIDDLE

    Setting pointer-events: none; on the top element will make it click through, and the click will be registered on the underlying element instead. The problem is that this will also disable other “pointer events” on the top element, and it’s only supported in modern browsers (read: not IE).

    Otherwise you would have to check the mouse position and see if it is inside the area covered by the first element, and that will be somewhat more complicated but there are answers on SO for this as well, try the search function!

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

Sidebar

Related Questions

Is it possible to detect the specific webcam hardware that a person is using
Is it possible to detect that the user has an external headset plugged into
Is it possible to detect that whether any modal dialog box is open over
Possible Duplicate: How to detect a click outside an element? I have a drop
Possible Duplicate: How to detect right mouse click + paste using JavaScript? How to
Possible Duplicate: Handling a Click for all controls on a Form I have a
I would like to detect mouse events like left button click, right button click
Possible Duplicate: How to detect a click outside an element? <ul id=rightNav> <li id=SettingOpt>
Possible Duplicate: How to detect a click outside an element? I have an element
Is it possible to detect all touch events in an Activity and capture it

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.