Internet Explorer does not offer support for stopping scrolling using either jQuery or CSS

I have created an overlapping screen similar to Facebook's photo viewer, and it works well on Chrome, Safari, and Firefox. However, I am struggling to make it work on Internet Explorer (IE). The issue is that the div overlaps correctly but allows scrolling, which I want to avoid. I tried using overflow: hidden; when a button is clicked to prevent scrolling, and it worked. But now I am facing difficulty in allowing scrolling again. I have experimented with overflow: auto and some jQuery functions, but they do not seem to solve the problem. Additionally, I noticed that certain jQuery functions like $(document).ready(function() { ... }); are not working properly.

This is the code snippet for the overlapping effect:

var outercontent = document.getElementById('transparent');
var innercontent = document.getElementById('innercont');
browser = navigator.appName;
explore = "Microsoft Internet Explorer";
if(browser == explore) {
    outercontent.style.zIndex = '9989';
    outercontent.style.display = 'block';
    outercontent.style.position = 'absolute';
    outercontent.style.top = '0';
    outercontent.style.left = '0';
    outercontent.style.width = viewportwidth;
    outercontent.style.height = viewportheight;
    outercontent.style.margin = '0';
    outercontent.style.padding = '0';

    innercontent.style.left = '20%';
    innercontent.style.background = 'white';
    innercontent.style.zIndex = '9999';
    innercontent.style.width = '60%';
    innercontent.style.height = '80%';
    innercontent.style.marginBottom = '10%';
    innercontent.style.marginTop = '5%';
    innercontent.style.padding = '10px';
}

In my HTML page, I have placed the following divs:

<div id='transparent' style='background-color: rgba(0, 0, 0, 0.5);
filter:
progid:DXImageTransform.Microsoft.Gradient(GradientType=0,
StartColorStr='#e5000000',EndColorStr='#e5000000');
text-align: center;'>
    <div id='innercont' style='position: absolute; color: black;'></div>
</div>

Answer №1

Why not try containing your material within a <div> element that has the properties height: 100%; overflow: hidden; nested inside of #innercont? This approach may offer better control over your content.

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

Troubleshooting issue: EJS loop not functioning correctly when handling JSON information

Having an issue with looping in an EJS file. Here's the data I'm working with: { "name": "Marina Silva", "info": [{ "periodBegins": "Sun Apr 14 23:48:36 +0000 2011", "periodFinishes": "Sun Apr 7 23:48:36 +0000 201 ...

Is there a problem encountered when attempting to pass an array value as a string using props in Vue.js?

<template> <div> <div v-for="piza in pizas" :key="piza.pname"> {{ piza.pname }} <List :content="matchpizza" :pname="piza.pname" :qname="quantitys.qname" /> </div> </div> </template> <scr ...

Ways to position a flexbox child at the bottom of its container

Utilizing Flexbox to arrange different content in a panel, there is an issue with the positioning of icons within each panel. The fourth icon wraps around and aligns with the first one at the top of its container, instead of lining up with the third icon a ...

Encountering a non-constructor error while trying to import packages in React Typescript

I am currently working on a project that utilizes React with Typescript. While attempting to import a package, I encountered an error stating that the package lacks a constructor when I run the file. This issue seems to be prevalent in various packages, a ...

An error occurred - 0x800a1391 - JavaScript runtime error: The function 'SelectAllCheckBoxes' has not been defined

I'm currently in the process of learning web development and I am trying to incorporate jQuery into my ASP .NET page. Within the header section, I have included the necessary references: <head id="Head1" runat="server"> <link href=" ...

Checking the parameters passed to a function in Typescript: A step-by-step guide

Currently, I am working with Typescript and then transpiling my TS code into JavaScript. However, I have encountered an issue that I am struggling to resolve. The error message I am facing is as follows: Error Found in TypeScript on Line:2 - error TS230 ...

What sets @vue/cli-plugin-unit-jest apart from vue-jest?

Can you explain the distinction between these two software bundles? @angular/cli-plugin-unit-jasmine angular-jasmin If I already have one, is there a need for the other? And in what circumstances should each be utilized? ...

Accessing a webpage's 'object' using Javascript

There is a webpage I came across with a wealth of data that needs to be documented. And like any regular individual, I’d prefer not to do it manually. Therefore, I was wondering if there is a way to ‘import’ a webpage ‘object’ that could provide ...

The dilemma of selecting objects in Three.js

Currently, I am developing a small web application that utilizes three.js. However, I have encountered an issue: I created a prototype with my three.js content and everything functions correctly (the canvas size in the prototype matches the browser window ...

What is the best way to toggle the visibility of a div using script with Bootstrap 4's latest display classes?

Upon page load, I have a hidden div using the d-none class from BS4. While I understand how to utilize responsive display classes in BS4, I am encountering an issue with showing or hiding this div via script due to the !important declaration in the CSS. T ...

Tips on creating a bot that patiently waits for responses before asking follow-up questions

I'm trying to develop my own bot for economics, but I've hit a snag. My goal is to have the bot ask a question, wait for an answer, and then ask another question, and so on. Can anyone offer some guidance on this issue? Here's the code I hav ...

Chrome Extension to Emphasize Every Word

As a novice, I am embarking on the journey of creating my own chrome extension. The idea is to design a popup.html file that showcases a "highlight" button. The functionality would involve clicking this button to highlight all words on the page. Here&apos ...

XMLHttpRequest changes the contents of UTF-8 encoded text

Encountered a challenging issue while processing a large XML file on the client side. Some unicode characters are being replaced with unreadable sequences, causing the server to be unable to parse the XML properly. Here is how I approached testing and hand ...

Utilizing MS SQL, AJAX, PHP, and JSON to fetch dynamic page content based on dropdown selection

I've hit a roadblock in my project. I'm currently working on an event registration system where a user selects an event from a dropdown menu populated by values and IDs retrieved from a SQL stored procedure (index.php). Upon selecting an event, I ...

jQuery used to select elements that are added dynamically on the page

Event Delegation in jQuery is a concept I am well-acquainted with. To listen for events on dynamically added elements, the following syntax is used: $('body .some-class').on('click', '.dynamically_added_ele', function(){}); ...

What are the reasons behind my inability to utilize the resources in the Django admin app?

I am trying to incorporate Django's contrib "admin" resources into my project. The "admin" package has a static directory with a file located at "static/admin/image/selector-icons.svg" that I want to reuse. Here is an excerpt from my settings.py: ST ...

The function chrome.cookies.get is returning undefined or causing an error to be thrown

chrome.cookies.get({url:"http://www.dahotre.com", name:"userid"}, function(){}) returns undefined when checked in the console. If I exclude the optional empty function(), it raises an error. chrome.cookies.get({url:"http://www.dahotre.com", name:"userid"} ...

What is the best way to shift a single vertex in AFrame?

When working with Three.js, I could easily manipulate vertices using this code: myObject.geometry.vertices[i].y += 12; However, in A-Frame, I am not able to see anything in the console.log. It seems that between versions 0.2.0 and 0.3.0, everything switch ...

Having issues with jQuery when trying to select only a single checkbox?

I have created a table with four rows and eight columns, each containing a checkbox. My goal is to allow only one checkbox to be checked per row. I am attempting to achieve this using jQuery. While it works in jsfiddle, I am experiencing difficulties in ge ...

Not every item in the array has been allocated to the model

I am encountering an issue with loading all the elements of an array from my ExpressJS backend to my frontend framework OpenUI5. Despite having an array of 520 elements, only the first 100 elements are being loaded into the model. How can I ensure that all ...