element.style{} when using popup and filter js

24 views Asked by At

I use MixItUp Js to create a filter for my product, I have a popup When opening the web to default, the filter is not selected, then element.style {} has an additional attribute:

transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transition: opacity 2.5s cubic-bezier(0.5, 0, 0, 1) 0.1s, transform 2.5s cubic-bezier(0.5, 0, 0, 1) 0.1s;

enter image description here

Make the popup part error

enter image description here

When changing the filter, the new popup is back to normal

enter image description here

I tried editing in js as follows:

let element = document.getElementById("services__card");
// Get the current value of the style . attribute
let currentStyle = element.getAttribute("style");
// Remove transform and transition properties from current value
let updatedStyle = currentStyle.replace(/transform:.*?;/g, "").replace(/transition:.*?;/g, "");
// Update new style value for element
element.setAttribute("style", updatedStyle);

The popup is working, but the filter is not working.

0

There are 0 answers