M
M
Maxim Vakaev2020-03-25 19:38:36
JavaScript
Maxim Vakaev, 2020-03-25 19:38:36

Why doesn't js work in safari browsers?

Tell me who understands why this code does not work in safari?
Thank you!

const modal = $('.modal__exit');

  document.addEventListener("mouseleave", function() {
    const close = localStorage.getItem("close");
    if (close !== "1") {
    	modal.show(300);
    }
    localStorage.setItem("close", "1");
  });

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Bogachev, 2020-03-25
@dev_max

modal show(...);

Most likely the problem is here. There are a lot of "jquery show/hide not working in safari" questions on SO. In general, you can give a recommendation not to use the show / hide functions, but to add your own CSS classes to the element, depending on its state.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question