Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.onload = function(){
- // small dialog
- // get the modal by its id
- var modal = document.getElementsByClassName("RemoveManufacturerModalContainer");
- // get the button what opens the modal by its id
- //var openModal = document.getElementsByClassName("open-me");
- // get the bunnton what closes the modal
- var close = document.getElementById('close-me');
- // get the close button
- var closeBtn = document.getElementById('closebtn');
- // when the user clicks on delete open the modal
- setTimeout(function() {
- var element = document.getElementsByClassName('open-me')[0];
- element.addEventListener("click", function(e) {
- alert('something');
- }, false);
- }, 500);
- // when the user clickson the x in the modal header
- close.onclick = function(){
- modal.style.display = "none";
- };
- // when the user clicks on the footer xlose button
- closeBtn.onclick = function(){
- modal.style.display = "none";
- };
- // if the user clicks anywere out of the modal close it
- window.onclick = function(event){
- if (event.target === modal){
- modal.style.display = "none";
- }
- };
- };
- // /. window onload
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement