The animate function in jQuery does not function properly in Internet Explorer 9 and earlier versions

I am experiencing an issue with jQuery animation that is not working properly in IE9 and older versions. I suspect the problem may lie within the CSS, as I have noticed that the opacity setting appears to be at 0 in IE.

Javascript

var $lead = $('.lead');
var height = $lead.height();
var totalHeight = height * numOfLeads;
function bounce() {
    var time = 400;
    var counter1 = 1;
    $($(".lead").get().reverse()).each(function() {
        setTimeout(function(el, counter1, height, totalHeight) {
            $(el).css({
                top: "-" + (totalHeight - (counter1 * height) + height) + "px",
                opacity: 0,
                display: "block",
                position: "relative"
            }).animate({
                top: "+=" + (totalHeight - (counter1 * height) + height) + "px",
                opacity: 1
            }, 1000, "easeOutBounce")
                    ;
        }, time, this, counter1, height, totalHeight);
        time += 400;
        counter1 += 1;
    });
}
bounce();

HTML

<div class="lead">
<div class="progress-bar">
    <div>
        <span class="first green end"></span>
        <span class="middle"></span>
        <span class="middle"></span>
        <span class="last"></span>
    </div>
    <span>Accepted</span>
</div>
<div class="product">Hypotek</div>
<div class="county">Ustecky</div>
<div class="change">
    <span>Changed</span>
    <div>22</div>
    <div>29</div>
    <div>38</div>
</div>

CSS

#leads{position: absolute;}
#leads, #leads div { z-index: 5;}
.lead { background: url("../images/lead_back_stripe.png") repeat-x scroll 0 0 transparent; height: 65px;}
.lead > div { float: left; padding-left: 20px; padding-top: 21px; width: 180px;}
.lead > div.progress-bar{width: 185px;}
.lead > div.product {width: 175px;}

You can view the complete content here

Is there anyone who knows where the issue might be originating from?

Answer №1

In short, the issue with setting opacity in IE is that it does not work as expected and the only workaround is to use filter: alpha(opacity = X); where X is a value between 0 and 100. However, this method does not play well with jQuery animations.

There may be a potential solution:

$(el).animate({
        opacity:1
},{
    step: function( now, fx ) {
        var X = 100 * now;
        $(fx.elem).css("filter","alpha(opacity="+X+")");
    }
});

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

Merge multiple Javascript files into one consolidated file

Organizing Files. /app /components /core /extensions - array.js - string.js /services - logger.js /lib - core.js Core.js (function() { 'use strict'; an ...

Triggering navigation to another screen from a separate component

After spending 6 hours attempting to solve this issue, I have reached my last resort. My goal is to switch screens using React Navigation. It works perfectly when all screens are in the same file. However, upon separating them into multiple files (1 file ...

Transmit and exchange events between two JavaScript files within a node.js environment

Having some trouble getting EventEmitter to work in both directions between two Javascript files. In my server.js file: let api = require('./api') // Not working api.on("yo", data => { console.log(data) }) // Working api.emit("ready", "S ...

Description of the image when clicking the next or previous button

Hey there, I'm new here and I could really use some help with an issue I'm facing regarding the image description in my gallery. When I click on a thumbnail, the description shows up just fine, but when I try to navigate using the next and previo ...

Masking characters in a textbox with ASP.NET MVC: A step-by-step guide

Within a partial view, there is a text field connected to a model property. This particular text box holds sensitive information that I would like to mask for security purposes. If I utilize EditorFor() with the input type set to "password", all of the ch ...

I'm looking for a solution to transfer data from Django views to a JavaScript script within a template. I'm currently working on creating a chart and need to showcase some specific information

I have a question regarding passing a variable into NEED_VARIABLE_PASSED. This block of code is located within one of my HTML templates. I am aware that I cannot directly use {{variable}}, so I am wondering if there is an alternate method to achieve this ...

Using d-flex instead of col in Bootstrap 4

With the new Bootstrap 4 transitioning from using 'floating' elements to the improved 'flexbox' method, I can't help but wonder if it's acceptable to build the entire grid structure using .d-flex instead of the conventional .c ...

Difficulty arises when trying to add various text fields to a collection

Lately, I've been making modifications to the Meteor1.3+React Todos app to familiarize myself with the basics, and I must say, it's been a smooth ride so far. However, I have encountered a roadblock. I want to incorporate an additional text field ...

Error Encountered during Deployment of Custom React App on Heroku due to Fetch API Issue

After developing a small app using React without CRA, I successfully deployed it to Heroku. However, I encountered an issue where a static JSON file that I created isn't fetching properly (it works fine on my local machine). Upon encountering this pr ...

Utilizing both italic and span tags within a list element in xslt with distinct separation

Just diving into the world of XSLT and seeking some guidance. I have a task at hand where I need to generate an XML file to be sent to Adobe InDesign server. The input HTML files contain "li" elements with nested "span" tags and "i" (italic) tags which I w ...

Ensuring Uniform Card Sizes in Bootstrap 4 for Multiple or Single Cards

Having trouble creating a page with N cards (single or multiple): https://i.sstatic.net/20WXc.png A single card appears like this: https://i.sstatic.net/01bP0.png I am unsure why the single card is not rendering correctly compared to multiple cards. T ...

When utilizing the $.ajax method with JsonResult, the response will contain the following code snippet: "toJSON - function (key) { return this.valueOf(); }

Here is the code snippet: Coding Section [HttpPost] public ActionResult GetNumbers(int id) { List<int> numbers = new List<int>(); //The desired numbers! numbers.Add(4); numbers.Add(8); retur ...

I am attempting to link a child object literal with a parent object literal

In a practical sense, I believe I can provide a clearer description of the problem I am encountering. What I am trying to achieve is linking a child entity to its parent. In my current scenario, I have two models: owner and property. An owner can have mult ...

interrupt the gameplay of fellow participants while engaging in one

I have a webpage where I am using the video.js framework to display multiple instances of <video> players. My goal is to pause any other playing videos when one of them starts playing. In other words, if one video is playing, all others should be pau ...

AngularJS - Filter out items from ng-repeat that match specific string criteria

After successfully cleaning up an external JSON URL feed by removing unnecessary special characters through a filter in my AngularJS code, I am now faced with the challenge of filtering out specific items from an ng-repeat based on a certain string. angul ...

Tips for showing data from an hour ago in Angular

Here is the code snippet provided: data = [ { 'name' : 'sample' 'date' : '2020-02-18 13:50:01' }, { 'name' : 'sample' 'date' : '2020-02- ...

Using jQuery to extract the HTML content of an element while removing the style attribute

Is there a way to retrieve the raw HTML of an element, or obtain the HTML without the "style" attribute applied? Let's consider the example below: <div class="outer"> <div class="inner"> some text </div> </div> A ...

Combining multiple events in jQuery to trigger a single Ajax function

What is the best way to optimize two jQuery events that use the same ajax function? $(document).on("focus blur change keyup", "#bc", function () { $.ajax({ XXXXXXXXXXXXXX }); }); $(document).on("change", ".op", function () { $.ajax({ ...

Retrieve the ID of the nearest div without it being executed twice

I am currently working on implementing a close button using 'onclick' functionality. The goal is to hide the parent ID element when the user clicks the button, as shown below. function displayNone() { var id= $('.btnClose').closest ...

Trigger a bootstrap modal using JavaScript within a PHP environment

Upon encountering a failed login attempt, I attempted to open a Bootstrap modal using the code below: if (mysqli_num_rows($query) != 0) { // Login successful } else { // Login failed echo '<script type="text/javascript"> $("#LoginF ...