Discovering a hidden DIV beneath other DIVs without disrupting their visibility - a step-by-step guide

I have created four separate DIVs that divide the screen equally into quarters. Additionally, there is a full-screen DIV designated for canvas.

My goal is to ensure that these DIVs do not overlap each other - meaning if a user clicks on a link within one of the smaller DIVs, they should access that link. However, if the user interacts with the canvas element in the larger DIV, it should respond accordingly.

Below is the code snippet. Appreciate any assistance!

#graph-container {
    top: 50px;
    bottom: 50px;
    left: 50px;
    right: 50px;
    position: fixed;
    z-index: 9;
    padding-left: 0px;
    padding-right: 0px;
    -webkit-animation: blink 2s linear 0s;
}


#NW { z-index: 10; position:fixed; width:50%; height:50%; top:0;   left:0; }
#NE { z-index: 10; position:fixed; width:50%; height:50%; top:0;   left:50%; }
#SW { z-index: 10; position:fixed; width:50%; height:50%; top:50%; left:0; }
#SE { z-index: 10; position:fixed; width:50%; height:50%; top:50%; left:50%; }

Answer №1

By using pointer-events, you can make it possible to click through the overlay div while still having clickable elements within the overlay.

Check out this example on jsFiddle: http://jsfiddle.net/42wyJ/5/

#NW{
    pointer-events:none;
}
#NW * { 
    pointer-events:auto;

}

Learn more about clicking through a DIV to underlying elements in this discussion.

For additional information on pointer-events, visit https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Stop closing the bootstrap modal popup when the space key is pressed

Is there a way to prevent the model popup from closing when the space or enter key is pressed on the keyboard? I have already tried using data-backdrop="static" data-keyboard="false" but it still closes. Additionally, I have ensured that the form tag is no ...

How about adding various colors in the background with layers?

I was recently given a task by a client to convert their picture art into CSS code. While I have successfully completed most of the task, I am facing difficulty in coloring the div similar to the example provided by the client. Here is the client's ve ...

As the number of lines increases by x%, CSS gradients gradually fade away during the generation process

Is there a way to create a gradient that displays a red line every x% without the colors fading into white? As I add more lines, the red stripes seem to lose their intensity and blend into a white background. The .four-stripes selector creates a good resu ...

Enhance your photographic experience with the JavaScript Camera API on Android (Froyo

I have been attempting to utilize the JavaScript Camera API through the Android browser, as showcased at Google IO on Froyo. Despite having Froyo on my Nexus1, I am encountering difficulties accessing navigator.device and navigator.camera properties, bo ...

Display a text over a full-screen HTML5 video

Is there a way to display text on a fullscreen video in HTML? I have tried using absolute positioning for the text and relative/fixed/none positioning for the video, but it does not work when the video is in fullscreen mode. I also attempted to call the ...

Is it possible to dynamically adjust the container size based on its content with the help of *ngIf and additional directives?

I have a single-image container that I need to resize when editing the content. The size should adjust based on the incoming content. See the images of the containers below: Image 1: This is the container before clicking on the edit button. https://i.sst ...

Rotate Chevron icon downwards on mobile devices in a Multilevel Dropdown Bootstrap 4

Bootstrap 4 is being utilized for my current project, I am looking to modify the rotation of the chevron icon in a multi-level dropdown menu specifically on mobile devices when the parent link is tapped, Here is the code snippet for the multi-level dropd ...

What is the process for connecting an HTML page to a CSS file located in a parent directory?

Here's the problem I'm facing: I recently encountered some organizational issues with my website, so I decided to reorganize my files for better classification. The current folder structure looks like this: www resources images ... css de ...

using localStorage to store multiple keys

My code attempts to generate multiple keys (user_0,user_1,user_3...) for the record(username,password,email). Even though I'm getting an alert saying "The data was saved," nothing is actually being stored in the local storage. Can someone help me figu ...

Tips for eliminating the jittery motion in an image gallery transition

I have a gallery of images that seems to be quite 'jumpy' when opening and closing the images, as demonstrated in this fiddle. Even after applying transform:translateZ(0); as suggested here, there doesn't seem to be much improvement in redu ...

aligning elements on various screens

Is there a way to achieve this layout on various screen sizes? The grey rectangles represent divs with content. Picture 1 (left) is for normal widescreen displays, picture 2 (middle) caters to smaller screens like netbooks or tablets, and picture 3 (righ ...

Utilize a CSS rule exclusively if the following div element is present - Purely CSS, no need

Can we apply a CSS rule only when a div follows another div? For example: <div class="div1">...</div> <div class="div2">..</div> CSS Example: (if div2 exists) .div2 .div1 (apply CSS rule to div1) { backgrou ...

Ways to fix text overlap in a pill

Click here to view the code on jsBin I quickly copied HTML/CSS code to jsBin using a tool called SnappySnippet. I attempted various solutions, but none of them worked. The best option for me seems to be overflow: ellipses word-break: break-word; word-b ...

The width of the HTML page seems to adjust or shift when I click on

I'm encountering an issue with my navbar. Whenever I open the dropdown menu, the width of my page changes but returns to normal when it is closed. <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="styl ...

Tips for preventing background scrolling of a Fixed element in React

Currently, I am working on a project using NextJS with Tailwind CSS. I am in the process of creating a drawer, popup, and modal with the CSS property position: fixed. However, I have encountered an issue where when I scroll on the fixed elements, the bac ...

Displaying information from a database in an HTML form using PHP

Seeking assistance with managing data and populating: I'm in the process of creating an Employee database with two pages: 1. Add Employee 2. Modify Employee The "Add Employee" page requires input fields for EMP Name, EMP ID, Manager name (from a dro ...

Select multiple items from a list in HTML using the power of jQuery with a Multi Select

I'm facing an issue with the multi-select box. I attempted to choose multiple values using jQuery, but only the last one seems to be selected. Can someone assist me, please? Below is my code: <script> $(function(){ <?php foreach ($selectd ...

Stop the image transformation/transition when the back face is not visible

Experience the magic of a box that flips with just a click. Inside, an image awaits to zoom in upon hovering. Check out this sample. The only glitch is that the zoom transition on the hidden image appears for a brief moment when I move my mouse out or ba ...

Tips for centering text in a dijitTextBox:

Ensure that the text is centered vertically with left padding and placeholder text included Check out the image link below: https://i.stack.imgur.com/PbHDa.jpg Snippet of my xPage code: <xe:djTextBox id="djTextBoxSearch" style="width:100%;height: ...

How can a div's height be adjusted based on the content of one sub div but not the other?

If I have a parent div with two child divs inside it, is it possible to set the parent div's height to auto, but only apply it to one of the child divs, while having the other child set to scroll for overflow-y? For example, you can see the issue her ...