The CSS animation spills out of the div container

I am encountering an issue with my code where the borders are not displaying as expected. The screen is divided into 8 equal parts, each of which should have a ripple effect. While everything works well in Chrome, Mozilla, Opera, and Safari, the ripple effect overflows the element in Internet Explorer. How can I resolve this problem?

$(document).ready(function () {
    $(".button_line").on('click', ".menu_button", function (e) {

        DoRipple($(this), e);

    });
}); 

var parent, ink, d, x, y; 

function DoRipple(parent, e) { 
    if (parent.find(".ink").length == 0) {
        parent.prepend("<span class='ink'></span>");
    } 

    ink = parent.find(".ink"); 
    ink.removeClass("animate"); 

    if (!ink.height() && !ink.width()) { 
        d = Math.max(parent.outerWidth(), parent.outerHeight());
        ink.css({ height: d, width: d });
    } 

    x = e.pageX - parent.offset().left - ink.width() / 2; 
    y = e.pageY - parent.offset().top - ink.height() / 2; 

    ink.css({ top: y + 'px', left: x + 'px' }).addClass("animate"); 
    
    function removeAnimationClass() { 
        ink.removeClass("animate");
    } 

    setTimeout( 
    function () { 
        ink.removeClass("animate"); 
    }, 650); 
}
html, body{ 
height:100%; 
width:100%; 
margin:0; 
padding:0; 
} 

.equal, .equal > div[class*='col-'] { 
display: -webkit-box; 
display: -moz-box; 
display: -ms-flexbox; 
display: -webkit-flex; 
display: flex; 
flex: 1 0 auto; 
} 

.button_line { 
height: 25%; 
width: 100%; 
} 

a.menu_button { 
width: 50%; 
height: 100%; 
float: left; 
background-color: white; 
display: table; 
border-collapse: collapse; 
text-decoration: none; 
color: black; 
position:relative; 
overflow:hidden; 
cursor:pointer; 
} 

a.menu_button > .menu_button_content { 
    display: table-cell; 
    vertical-align: middle; 
} 

a.menu_button > .border_overlay { 
    height:100%; 
    width:100%; 
    position:absolute; 
    border-right: 1px solid #E6F0F0; 
    border-bottom: 1px solid #E6F0F0; 
}

    a.menu_button > .menu_button_content > h2 { 
        text-align: center; 
        font-size: 1.1em; 
        font-family: 'Roboto', sans-serif; 
        font-weight: 400; 
    }

    // Additional CSS properties...

.ink { 
    display: block; 
    position: absolute; 
    background: #006064; 
    border-radius: 100%; 
    transform: scale(0); 
}
    
@keyframes ripple { 
    100% { 
        opacity: 0; 
        transform: scale(2.5); 
    }
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<div class="button_line"> 
                    <a class="ol-md-6 menu_button" id="Residence"> 
                        <div class="border_overlay"></div> 
                        <div class="menu_button_content"> 
                            <h2 id="ResidenceText"> 
                                <asp:Literal runat="server" Text="<%$ Resources: Strings, Residence %>" /> 
                            </h2> 
                            <div class="menu_button_color_rectangle" id="residence"></div> 
                        </div> 
                    </a> 
                    // Repeat for other menu items...
                </div>

Answer №1

the reason for the issue is due to having a display:table on your a.menu_buttom.. Try replacing it with display:block. This solution worked perfectly for me while using IE.

$(document).ready(function () {
    $(".button_line").on('click', ".menu_button", function (e) {

        DoRipple($(this), e);

    });
});

var parent, ink, d, x, y;

function DoRipple(parent, e) {
    if (parent.find(".ink").length == 0) {
        parent.prepend("<span class='ink'></span>");
    }

    ink = parent.find(".ink");
    ink.removeClass("animate");

    if (!ink.height() && !ink.width()) {
        d = Math.max(parent.outerWidth(), parent.outerHeight());
        ink.css({ height: d, width: d });
    }

    x = e.pageX - parent.offset().left - ink.width() / 2;
    y = e.pageY - parent.offset().top - ink.height() / 2;

    ink.css({ top: y + 'px', left: x + 'px' }).addClass("animate");

    function removeAnimationClass() {
        ink.removeClass("animate");
    }

    setTimeout(
    function () {
        ink.removeClass("animate");
    }, 650);
}
html, body{
height:100%;
width:100%;
margin:0;
padding:0;
}

.equal, .equal > div[class*='col-'] {
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    flex: 1 0 auto;
}

/* CSS Styles continue here... */

</div>

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

Showing data from a JavaScript controller's JSON response in an HTML table

I'm currently developing a spring app using AngularJS and I have a response coming from a JS controller. My goal is to showcase this response in a table on the webpage. The object devDebtTable is accessible to the page from the JS controller. The JS ...

What is the method for utilizing alpha transparency in MPDF?

I am currently working with MPDF to generate a PDF file with a full-page background. I want to create a layout similar to the image shown https://i.sstatic.net/RoH3r.png. I believe that I need to incorporate alpha transparency, but I am unsure of how to d ...

Alter the class following modifications to the list

https://i.stack.imgur.com/QZob0.pngIn my dual list, the data is displayed in a ul li format fetched from a JSON file. Users can move items between the two lists. However, I am facing an issue where I want to apply a property that only displays content with ...

I'm encountering an issue in JavaScript while attempting to convert the following string into a JSON object. Can anyone assist in identifying the problem with this string?

How can I correct this string to make it a valid JavaScript JSON object? txt = '{"Categories" : [{"label":"petifores","id":"1"}, {"label":"wedding cake","id":"2"}, {"label":"shapes of cakes","id":"3"}, ...

I recently started delving into React Native and am currently exploring how to implement custom fonts in my application. However, I have encountered an error that is preventing me from successfully integrating

The Issue: The error I encountered only appeared after including font-related code (such as importing from "expo-font" and using "AppLoading" from "expo", and utilizing the "Font.loadAsync()" function). Error: Element type is invalid: expected a string (fo ...

Protect your website's ajax-generated content from being indexed by search engines with these strategies

Recently, Google made an update allowing its crawler to index ajax-generated content on web pages by following specific guidelines. However, my requirement is to ensure that no search engine can crawl my ajax-generated content. So, my question is: What ...

React material-ui responsive carousel is a versatile tool that allows for

I am in the process of creating a music tour website using React material-ui. My goal is to replicate the design of this website: As a newcomer to React, I explored libraries like bootstrap and material-ui before settling on material-ui. However, I'm ...

jQuery-powered cookie creations

I want to create a functionality where checkboxes, once clicked, are stored in a cookie using jQuery. Here is an example of my code: <input type="checkbox" value="vat_50" name="vat_50" class="tax"> <input type="checkbox" value="vat_34" name="vat ...

String casting for large JavaScript integers may require rounding to function properly

When trying to pass a large integer to a function from an onclick event in HTML, I always encounter issues with rounding. Despite using bigInt libraries, I still struggle to pass the full number accurately and would prefer a simple string casting method. ...

Guide on incorporating an inline input and glyph icon within a table cell using Bootstrap 3

How do I align my glyph icon in the same line as an input in Bootstrap3? I've tried various classes but none seem to work. The glyph icon keeps displaying on a separate line because the input is too long. The only solution that works is manually setti ...

Improving Rails coupling by integrating AJAX

I am currently in the process of developing a small blog application to enhance my skills with Rails. This app will allow users to log in, create posts, and comment on other users' posts. As of now, I am working on integrating Ajax into the 'add ...

The ng-blur functionality will only trigger if the click event occurs within the bounds of the textbox

I am facing an issue with a textbox that should display a certain value even after being deleted. When the input is cleared and clicked away from, I want the value to reappear in the textbox. Currently, there seems to be a problem with this functionality ...

Tips on specifying a default value when receiving data from an API

I am working with a dropdown list that is populated from an API call. Here is my code snippet: <label>User Code:</label> <select ng-options="c as c.User for c in userList" ng-model="selectedUser" id="search3"> </select> To fet ...

Position a div at the bottom of another div using Bootstrap

I'm facing an issue with trying to position an inner div at the bottom of an outer div using bootstrap classes. I have attempted various methods in both bootstrap and regular CSS, such as vertical-align: bottom; and setting position to absolute, but n ...

Verifying input for Numeric TextField

The text field being used is: <TextField variant="outlined" margin="normal" id="freeSeats" name="freeSeats" helperText={touched.freeSeats ? errors.freeSeats : ''} error={touched.freeSeats && Boolean(errors.fre ...

Submitting Data Forms with AJAX on dynamically loaded webpages

Issue with Form Submission in Ajax-Generated Page I am experiencing an issue with form submission on a page generated within AJAX. The page contains two forms, #form1 and #form2. The jQuery code for submitting the form is as shown below: jQuery("#form1" ...

Tips on sending a string as an argument in an onclick function

I am currently attempting to automatically add an anchor, and here is what I have tried: " <a id='" + x.NomFic + "' onclick='TransfererFica( " +x.Idtran +" , "+ x.NumVdr + " , '" + x.NomFic ...

Make sure to wrap the component in a provider, no matter how many times you have already done so

I am facing an issue while using nextjs in combination with react redux. The error message I am encountering is: Error: could not find react-redux context value; please ensure the component is wrapped in a <Provider>. Despite trying various solut ...

Error: The variable `$` has not been defined in your Vue.js webpack project

Encountered an error in the browser console while running a Vue.js webpack project. https://i.sstatic.net/s2mEp.png The error occurred due to minimized js files within core.min.js. Specifically, the jQuery minimized js is included inside core.min.js. To ...

The elements being parsed are appearing as undefined

Currently, I am attempting to analyze this JSON structure: { "customers": [ { "name":"joe" , "cars":[ {"name":"honda","visits":[ {"date":"01/30/14","Id":"201"}, {"date":"01/30/14","Id":"201"}, {"date":"02/12/14","Id":"109"} ...