Last active
April 6, 2023 08:05
-
-
Save niranyousuf/7a1b9022424ab129d63d3596647455b2 to your computer and use it in GitHub Desktop.
If any one want to leave from browser you can show him pop up
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (document.querySelector('.en-popup')) { | |
var popUp = document.querySelector('.en-popup'); | |
document.addEventListener("mouseout", function popUpEventHandler(e) { | |
if (e.toElement === null) { | |
popUp.classList.add('show') | |
document.body.classList.add('popup-no-scroll') | |
this.removeEventListener('mouseout', popUpEventHandler); | |
} | |
}) | |
var closePopUp = document.querySelectorAll('.close-popup'); | |
closePopUp.forEach((closePop) => { | |
closePop.addEventListener('click', () => { | |
popUp.classList.remove('show-en-popup') | |
document.body.classList.remove('popup-no-scroll') | |
}) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
`(function ($) {
"use strict";