Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

popup in browser js

alert("Hello World!");
const result = prompt(message, default_value);
const result = confirm(message);
Comment

popup javascript

alert("This page uses cookies.");
Comment

make popup js

function popup(url, width, height) {
    var left = (screen.width/2)-(width/2);
    var top = (screen.height/2)-(height/2);
    return window.open(url, '', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+width+', height='+height+', top='+top+', left='+left);
}
Comment

javascript for pop up

<script> 
        function myFunction() {
            var r = confirm("OK to delete?");
            if ($r == false) {
                return false;
                } 
        }
    </script>
Comment

popup javascript

const show_popup = () => {
    const popup = $(".popup");
    const popupItems = document.querySelectorAll(".popup__item");
    const popupWrap = $(".popup__wrap");
    const popupOverlay = $(".popup__overlay");
    const popupClose = $(".popup__close");
    const btnsPopup = $$(".btn_popup");
  
    btnsPopup.forEach((btn) => {
        btn.addEventListener(["click"], () => {
            showPopup(btn.getAttribute("data-popup"));
        });
    });
  
    const showPopup = (index) => {
        popupItems.forEach((popup) => {
            popup.classList.remove("show_data");
        });
        popup.style.display = "block !important";
        $(`.popup__item[data-popup="${index}"]`).classList.add("show_data");
        popupWrap.classList = `popup__wrap popup__wrap--${index}`;
        setTimeout(() => {
            popup.classList.add("show_data");
        }, 10);
    };
    const closePopup = () => {
        popup.classList.remove("show_data");
        setTimeout(() => {
            popup.style.display = "";
            popupWrap.classList = `popup__wrap`;
        }, 500);
    };

    popupOverlay.addEventListener("click", closePopup);
    popupClose.addEventListener("click", closePopup);

};
show_popup();
Comment

PREVIOUS NEXT
Code Example
Javascript :: ant design charts 
Javascript :: javascript find index 
Javascript :: prevent refresh react 
Javascript :: javascript add to html 
Javascript :: js check invalid date 
Javascript :: select parent of element jquery 
Javascript :: Check for mobile device 
Javascript :: get current location city name react native 
Javascript :: get url parameter nuxt 3 
Javascript :: convert string to object javascript 
Javascript :: shuffle an array 
Javascript :: code intialization problem javascript 
Javascript :: how draw table from json ajax 
Javascript :: animate javascript 
Javascript :: js set iframe code 
Javascript :: react native debugger 
Javascript :: How to pass setInterval() into a Javascript class method 
Javascript :: how to convert utc time to local time angular 
Javascript :: initialize a map js 
Javascript :: javascript regex match character from a set of characters 
Javascript :: subtrair datas javascript frontend 
Javascript :: javascript remove from array 
Javascript :: js import export 
Javascript :: how to change input value in javascript using class 
Javascript :: JavaScript next() Method 
Javascript :: how to send the mail using node with template 
Javascript :: using express js response render parameter in ejs script tag as a variable in node js 
Javascript :: es6 spread 
Javascript :: Vue 3 script setup props emits 
Javascript :: Making promises 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =