Unable to click on overlay in Internet Explorer version 8

When I click my overlay in different browsers like Firefox, Chrome, and IE9, the onClick function is triggered as expected. However, in IE8, it seems like the box is not clickable at all and the content behind it is receiving the click events instead. Here's a snippet of my code:

HTML:

<div id="pageblock" onclick="closelogin()"></div>
<div id="loginbox"><!--This is where my form is--></div>

CSS:

#loginbox{
    z-index: 10;
    position: absolute;
    height: 83px;
    top: 105px;
    right: 20px;
    width: 400px
    overflow: hidden;
    padding: 5px;
}
#pageblock{
    display: none;
    position: fixed;
    z-index: 7;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: #000;
    opacity: 0.6;
height: 100%;
width: 100%;
}

CSS for IE8 and earlier:

#pageblock{
background: transparent !important;
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000,endColorstr=#99000000)";
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000,endColorstr=#99000000);
}

Hopefully this helps pinpoint the issue! Thanks!

Answer №1

The issue that you've correctly identified arises from the utilization of -ms-filter. It appears that applying the filter alters how the browser calculates the width and height, resulting in a reduced clickable area confined to the text within the pageblock div rather than encompassing the entire div itself.

A straightforward remedy would be to utilize a background image: implementing a small 5px x 5px 60% transparent black .png will suffice, contribute minimally to your overall page size, possess support from IE7 onwards, and prevent overwriting the width/height declarations designated for pageblock.

Upon reviewing the code you provided, I observe several other issues; the z-indexing you've implemented causes the loginbox to overlay the pageblock (is this intentional?). Additionally, specifying that the loginbox should be positioned 20px from the right of the page while assigning it a width of 100% results in a total width exceeding what your page can display. It is advisable to avoid mixing measurement units - either make the right position percentage-based and subtract it from the width declaration, or specify the width of the loginbox in pixels. This approach will save you numerous headaches in the future.

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

Find all elements located in between two headers with varying ids

I am trying to select a specific range of elements in between two headers, excluding everything after the second header. For example, I want to select elements 1-5 from the following code snippet: <!DOCTYPE html> <html> <head> <link r ...

angular.js selected row in a table

I am facing an issue with a table that includes the ng-class directive in the following format: <tbody> <tr style="cursor: pointer" class="clickable-row" ng-repeat="firm in device.firmwares" ng-class="{'success': firm.vulnScore< ...

SVG Star Rating system designed to accommodate ratings with decimal points

I am struggling with creating a star rating using SVG for the first time. I need the rating to be out of 5 and display decimal ratings like 4.5, 3.2, 1.1 along with whole stars. The rated stars should be yellow while the remaining stars should be grey. How ...

Using jQuery to enhance your input labels

<div id="one"> <label for="number">Number</label> <div id="two"> <input id="number" type="text" name="number"> </div> </div> This displays the following: Number [input] Is there a way to ...

Misconception about the usage of jQuery's .each() function clarified with an illustrative example

Problem Description (See Fiddle): When clicking on the red boxes, they transform into kittens and display an alert with the current value of i. Clicking on a large fading kitten will reset everything. I am puzzled as to why alert(i) is triggering multipl ...

The icon must be aligned to the right and able to adapt to different

I'm attempting to align a Font Awesome icon to the right while keeping an input field aligned to the left on the same line. Both elements should be responsive and maintain their positions. I've created a sandbox and an image showcasing how it cu ...

Issues with Angular's :has selector functionality are causing it to perform inaccur

I've been attempting to make the has selector function properly with angular. Here's my HTML code: <ul class="check-list no-bullet-points mb-0"> <ng-container *ngFor="let item of checkList.items"> &l ...

Implementing a button on a polygon shape within an SVG

I have an SVG at the bottom and I would like to place a button on the bottom line that is also responsive. How can I achieve this using CSS? What I am trying to accomplish: Example Image Is it possible with just CSS and how should I go about implementin ...

Changing the background color of the canvas using Javascript

I want to create a rect on a canvas with a slightly transparent background, but I don't want the drawn rect to have any background. Here is an example of what I'm looking for: https://i.stack.imgur.com/axtcE.png The code I am using is as follo ...

CSS techniques for positioning a header image

I'm having an issue with using a banner I created in CS6 Illustrator as a header on my website. Despite setting it as the background, positioned at the top and set to "no-repeat", it keeps appearing at the bottom of the header area with around 300px o ...

What is causing the issue with the italic font not displaying properly?

I am currently learning CSS. I attempted to make a portion of my text italicized, but for some reason, the text refuses to adopt the desired style. Any ideas on what might be causing this issue? .bold { font-weight: bold; } .italic { font-weight: i ...

Transform the entire content with a simple click on input labels

tab3 > brand-sidebar-wrapper > lacquer-type-wrapper > input Whenever I click on the input labels, the .content div moves to the top and leaves a lot of space at the bottom. I have attempted to modify the JavaScript code, but the issue seems to b ...

"The CSS animation effect for underlining text does not seem to be

I'm trying to create a CSS animation using the transform property. Specifically, I want to have an underline animation when a link is hovered over. Strangely, the code that works in another HTML file is not working here. Although the links change colo ...

Utilizing Bootstrap 5: Breaking a Page into Two Separate Vertical Sections

I am looking to design a unique grid system that divides the page into either 2 columns or 2 rows that are completely separate from each other. This means that the content on one side of the page does not expand to match the height of the content on the ot ...

IE11 not running Angular code inline as expected

Currently in the process of developing an AngularJS application, I came across a strange issue that I have never encountered before. It may be a simple fix, but I am unsure of the exact terminology to search for the right solution, so I apologize in advanc ...

What is the best way to create an animation that highlights button content?

I am looking to add animation to my button, where the arrows change color from white to accent (border color) in sequence from left to right. There should be a delay of around 50ms before each arrow is highlighted. https://i.sstatic.net/4zwZo.png <butt ...

When working with TextareaAutosize component in MUI, an issue surfaces where you need to click on the textarea again after entering each character

One issue that arises when using TextareaAutosize from MUI is the need to click on the textarea again after entering each character. This problem specifically occurs when utilizing StyledTextarea = styled(TextareaAutosize) The initial code snippet accompl ...

Struggling with generating forms using AJAX, Javascript, and HTML depending on the selection made from a drop-down menu

I am in need of a simple web form for work submissions within my organization. These submissions will fit into 4 Categories, each requiring unique information. Currently, I have a basic form set up with fields such as Requested Name, Requested Date, Acquis ...

Numerous sections with tabs on the webpage

I am in need of incorporating multiple tabbed sections on a single page, but unfortunately they are currently interconnected. When one tab is clicked, it impacts the others. To see this issue in action, you can visit: https://jsfiddle.net/pxpsvoc6/ This ...

Ensure the Next/Image component fits neatly inside a div without distorting its aspect ratio, and keep the

I've been attempting to style a NextJS image in a way that it has rounded corners, expands to fit its container div (which is blue in the image), and maintains its aspect ratio (only known at runtime). However, what I currently have is not working as ...