Inversion filter malfunctioning on Internet Explorer and Safari

Having issues with inverting image colors on IE and Safari. I'm working on a navigation feature where images change color when clicked or hovered over, but this functionality isn't working on IE and Safari.

A function issue
{
$('.pressed').removeClass('pressed');

    $('#'+imgid)
        .toggleClass('pressed')
        .css('z-index',2);

}

function toggleVisible() {
            if (document.getElementById('mapButtons')) {

                if (document.getElementById('mapButtons').style.display == 'none') {
                    document.getElementById('mapButtons').style.display = 'block';
                    document.getElementById('modelButtons').style.display = 'none';
                }
                else {
                    document.getElementById('mapButtons').style.display = 'none';
                    document.getElementById('modelButtons').style.display = 'block';

                }
            }
}
function flipImage() {
    $('.side').toggleClass('rotated');
}
$(function() {
    $('area').mouseover(function() {
        var imgid=$(this).data('imgid');
        $('#demo').text("Mouseover for "+imgid);
        $('#'+imgid)
            .toggleClass('invert',true)
            .css('z-index',2);
    }).mouseout(function() {
        var imgid=$(this).data('imgid');
        $('#mi').text("Mouseout for "+imgid);
        $('#'+imgid)
            .toggleClass('invert',false)
            .css('z-index',1);
    }).click(function() {
    var imgid=$(this).data('imgid');
    $('#demo').text("click for "+imgid);

    $('.pressed').removeClass('pressed');

    $('#'+imgid)
        .toggleClass('pressed')
        .css('z-index',2);
});
});
... (Other CSS and HTML code snippets included) ...

Answer №1

The filter property is considered experimental and is not supported on Internet Explorer.

To achieve color inversion on an image, you can create a sprite with two separate images and display them in CSS using the background-image and background-position properties, for example.

For examples of sprites, visit this link

As mentioned:

A web page with many images can take a long time to load and result in multiple server requests.

Using image sprites reduces the number of server requests and saves bandwidth.

You can create sprites with all your images and their inverted versions, then obtain the background-position CSS using this website

If loading is still slow, optimize the image using TinyPNG, view this link:

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

Element with absolute position does not expand along with scrollable content (over 100%)

In my popup window, the fade element is supposed to stretch to the full width of the screen. However, when the content exceeds 100% of the browser window height, the element does not extend to the full page height. If I set html, body { height: 100%; over ...

KnexJS Update Error: Failed to perform database update operation

I'm attempting to update a specific line in my database by utilizing Knex's update method. Although the command returns success, I notice no changes reflected in my database upon inspection. Below is the code snippet: async multipleConciliation( ...

Generate a dynamic animation showcasing transparency effects, uncovering the intricate Mesh structure within threejs

Is there a way to achieve a linear animation in THREE.JS that reveals a complex 3D mesh from the bottom to the top, similar to a slideUp effect in 2D jQuery objects? After searching for options such as opacity channels or maps, it seems that they are not ...

Is it possible for certain text within a textbox to activate a jQuery event?

In the development of my MVC ASP.Net application, there is a requirement for users to fill out a form. Specifically, there is a text box where users must input the duration of their current employment. If the user indicates less than three years, an additi ...

Sending a component as a prop to another component

I want to pass a component with props as a prop to another component. Here is an example of what I am trying to achieve: const App = ({ routes, graphqlProvider, themeProvider }) => { const GraphqlProvider = graphqlProvider const ThemeProvider = the ...

Positioning a div at the bottom of the viewport, centered with 2 rows of 6 elements, and adjusting its size to fit the page

I've searched for answers but haven't found anything that works for me. I'm looking to have 2 rows of 6 elements at the bottom of the page and have them stick there as the page scrolls. I tried using a table, which almost worked. .center ...

How can I convert dates into a different format?

I have various event dates that are stored in the format 20131212 or 20100125, or any date submitted by a user for an event (formatted as yyyymmdd). I have created a function that displays all events for a specific month. However, the date is currently di ...

Looking to implement a time delay within a jQuery function?

I'm working on a jQuery function that requires a one second delay when the captcha is filled in correctly. This delay allows the #captchaStatus to display before moving on to the next step of posting html content. While I'm still learning jQuery ...

Updating properties of nested objects in React JS

When I call this function using the onChange property of an input field, the first console.log displays the changed value accurately. However, the second one does not show the expected result. Despite attempting to deep copy newDisplayedAssignment and mak ...

When converting to a React Functional Component using Typescript, an error occurred: The property 'forceUpdateHandler' could not be found on the type 'MutableRefObject<Spinner | null>'

Looking to convert the App component in this CodePen into a Functional component using Typescript. Encountering an error when attempting to run it: ERROR in src/App.tsx:13:14 TS2339: Property 'forceUpdateHandler' does not exist on type 'Mu ...

In an HTML template, what is the significance of the $ symbol?

Currently, I am exploring the web.py framework with the help of a tutorial that I found online. This tutorial focuses on Python and AJAX functionalities. One thing that is confusing me in the tutorial is the use of variables with a $ sign in the tutorial ...

Ways to retrieve information from a URL using the .get() method in a secure HTTPS connection

As I work on handling user input from a form using node.js, express, and bodyParser, I encounter an issue. Even after using console.log(req.body), the output is {}. This is puzzling as there is data in the URL when the form is submitted successfully at htt ...

React Transition Group failing to apply CSS classes

I am utilizing React Transition Group to apply animations with different timeouts to each item. However, the issue arises when my links do not receive any classes. Despite this, wrapping the ScrollLinks tag with TransitionGroup allows the animation to func ...

Activate the popup for sharing or bookmarking by clicking on a regular link

I am currently utilizing a Share/Bookmark script: <div class="singles-right"> <a href="#" class="bookmark"></a> <script type="text/javascript" src="http://static.addinto.com/ai/ai2_bkmk.js"></script> <a href="#" clas ...

The textures in three.js material do not interact with lighting sources

I am curious about whether a textured geometry can be successfully lit in three.js. In my current scene, I have noticed that all materials receive lighting effectively when using spotLight and directionalLight, except for those that have a texture applied ...

Arrange Bootstrap-Vue table in a custom order of days (mon, tue, wed) instead of the default

I'm working on a table that populates data from a database using Bootstrap-vue. The database includes a field labeled "day" which contains string values like "mon", "tue", "wed", and so on. I need the table to sort this column by day order rather than ...

What is the procedure for re-executing the request handler in a Node.js and Express application?

Currently, my setup involves node, express, and mongojs. Here is a code snippet that exemplifies my configuration: function mongoCallback(req, res) { "use strict"; return function (err, o) { if (err) { res.send(500, err.message); } else ...

When text-indent is assigned a percentage value, what determines the width that is used in the calculation?

Here's another issue I encountered while working on revising my Textarea Line Count plugin (shameless promotion). CSS's text-indent property allows for creating white space before the first line of text. It can be specified in various units like ...

Transfer the href from a TD element to a value attribute, then include the URL attribute with the stored href in a

I am attempting to transfer the href attribute from one TD element to another TD element within the same TR. jQuery('.course-number a').each(function () { var lnk = jQuery('this').attr('href'); jQuery(this).sibling(&a ...

aligning a form vertically in a container

<div class="parent"> <div class="left-child"> <img src="logo.jpg" alt="logo"> </div> <div class="right-child"> <form action="#"> <input type="text" value="search"> &l ...