{"id":2089,"date":"2024-10-30T17:28:03","date_gmt":"2024-10-30T17:28:03","guid":{"rendered":"https:\/\/casinodatacenter.ru\/?p=2089"},"modified":"2024-11-04T09:41:23","modified_gmt":"2024-11-04T09:41:23","slug":"vanilla-javascript-modal-with-multiple-open-close-handlers","status":"publish","type":"post","link":"https:\/\/casinodatacenter.ru\/?p=2089","title":{"rendered":"Vanilla JavaScript Modal With Multiple Open\/close Handlers"},"content":{"rendered":"<div class=\"entry\">\n<p>In this post I want to show how we can easily create a modal with vanilla JavaScript. It can have multiple open\/close handlers thanks to querySelectorAll. First of all lets create the HTML structure for our modal. Now lets add some style. Notice that 3 attributes on .modal class. It will keep the modal hidden by default, later we will use JavaScript to add a .visible class to make our modal appear on the screen. Finally lets write some JavaScript code to give interaction to the modal. We begin finding what we need to interact in the DOM. Now we loop through our open and close handlers to add it a click eventListener. We added a call to an open and and close functions when the click event gets fired. Lets create these two. When our openModal function gets fired, we simply add a class .visible to the main .modal class. So we can toggle its visibility with CSS. It&#8217;s just to add some cool animation in out. Thats all we need and our modal is ready. Vanilla JavaScript is pretty easy nowadays, in the past it would be a pain in the ass to make such a simple thing.<\/p>\n<p>When I sing at people\u2019s houses, unless they send a carriage for me, the cab-fare is 4 considered in my wages. May complied, and the cab moved away slowly. When they had proceeded a few yards, Clara said, \u00ab1 wanted to tell you-I think it right to tell you&#8212;something I have learned on good authority. May\u2019s first thought was that here again her Aunt Pauline had deceived her! \u00abAre you sure?\u00bb she asked. \u00abAnd how did you learn it? \u00abOh, from Signor Valli! \u00abIn some ways not. But I do not doubt what he says on this subject. He has no motive to invent the information. He cares nothing about the matter&#8212;except that I think he rather likes La&#8212;Mrs. \u00abIs she a foreigner? \u00bb asked May, with a little more interest than she had hitherto shown. Her listless way of receiving the news had surprised her friend. \u00abYes, an Italian. At least, she is Italian by language, if not by law; for she comes from Trieste.<\/p>\n<p>2. &#8212; P. 125-141. &#8212; ISSN 1726-670X. &#8212; doi:10.31269\/vol7iss2pp125-141. \u2191 \u0411\u044d\u043a\u043e\u043d \u0424. \u0412\u0435\u043b\u0438\u043a\u043e\u0435 \u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u041d\u0430\u0443\u043a \/\/ \u0421\u043e\u0447\u0438\u043d\u0435\u043d\u0438\u044f \u0432 \u0434\u0432\u0443\u0445 \u0442\u043e\u043c\u0430\u0445. 2-\u0435 \u0438\u0441\u043f\u0440. \u0438 \u0434\u043e\u043f. \u041c.: \u041c\u044b\u0441\u043b\u044c, 1977. &#8212; \u0422. 1. &#8212; \u0421. 72. &#8212; (\u0424\u0438\u043b\u043e\u0441\u043e\u0444\u0441\u043a\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u0438\u0435). \u2191 \u0414\u0436\u043e\u043d \u041b\u043e\u043a\u043a. \u041e\u043f\u044b\u0442 \u043e \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u043e\u043c \u0440\u0430\u0437\u0443\u043c\u0435\u043d\u0438\u0438. \u2191 1 2 P. Adriaans, J. van Benthem. Introduction: Information is what information does \/\/ Philosophy of information (\u0430\u043d\u0433\u043b.). \u2191 1 2 3 Keith Devlin, Duska Rosenberg. INFORMATION IN THE STUDY OF HUMAN INTERACTION (\u0430\u043d\u0433\u043b.) \/\/ Philosophy of Information. \u2191 \u0413\u043e\u0443\u043b\u0434\u043d\u0435\u0440 \u0410. \u041d\u0430\u0441\u0442\u0443\u043f\u0430\u044e\u0449\u0438\u0439 \u043a\u0440\u0438\u0437\u0438\u0441 \u0437\u0430\u043f\u0430\u0434\u043d\u043e\u0439 \u0441\u043e\u0446\u0438\u043e\u043b\u043e\u0433\u0438\u0438. \u041d\u0430\u0443\u043a\u0430, 2003. &#8212; \u0421. \u2191 \u0421\u0435\u0440\u0442\u043e \u041c. \u0434\u0435. \u0418\u0437\u043e\u0431\u0440\u0435\u0442\u0435\u043d\u0438\u0435 \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u043e\u0441\u0442\u0438. &#8212; \u0418\u0437\u0434\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u0415\u0432\u0440\u043e\u043f\u0435\u0439\u0441\u043a\u043e\u0433\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0430 \u0432 \u0421\u0430\u043d\u043a\u0442-\u041f\u0435\u0442\u0435\u0440\u0431\u0443\u0440\u0433\u0435, 2013. &#8212; \u0421. \u2191 1 2 3 Geoffrey Nunberg. Farewell to the Information Age \/\/ The future of the book (\u0430\u043d\u0433\u043b.). \u2191 Claude E. Shannon, Warren Weaver. The Mathematical Theory of Communication. \u2191 1 2 3 Gernot Wersig. Information theory \/\/ International encyclopedia of information and library science (\u0430\u043d\u0433\u043b.) \/ John Feather, Rodney P. Sturges. 2. ed. &#8212; London: Routledge, 2003. &#8212; 688 p.<\/p>\n<p>Mark\u2019s extraordinary and audacious personality. Vera adopted a more active role in their intercourse. Tatiana Markovna and Raisky had remarked in her. Volga. What was the Wolf doing now? In the courtyard a scene by no means unusual was being enacted. God to witness of her sincerity. Raisky said in a low voice that he must speak with her. \u00abGrandmother, what is the matter with you? \u00bb cried Raisky barring her way. \u00abDon\u2019t come here. I will see no one. \u00abHelp her as far as you can. Raisky that she intended to drown herself. \u00abHow heavy is the burden! \u00abMy sin! my sin! Tatiana Markovna\u2019s servants had lost their heads in terror. Yakob hardly stirred from the church. For two days already Tatiana Markovna had eaten nothing. I must endure to the end. Do you raise me if I fall. \u00abGrandmother!\u00bb he cried, kissing her hand. Things were not going any better with Vera.<\/p>\n<p>Chrome \u0434\u043b\u044f Android \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f. \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Privacy Badger \u043d\u0430 Android, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 Firefox \u0434\u043b\u044f Android. Privacy Badger \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 Microsoft Edge Legacy. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 Microsoft Edge. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e Microsoft Edge \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445. \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435\u0441\u044c Google Chrome, \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d Chrome \u043e\u0431\u0435\u0437\u0430\u0442\u0435\u043b\u0435\u043d \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439. \u0427\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Privacy Badger \u0432 Chrome, \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 Privacy Badger \u0432 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0435 Chrome \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u0442\u0430\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \u201c\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u201d. I run a domain that uses cookies or other tracking. How do I stop Privacy Badger from blocking me? One way is to stop tracking users who have turned on Global Privacy Control or Do Not Track signals (i.e., stop collecting cookies, supercookies or fingerprints from them). Privacy Badger will stop learning to block that domain. The next version of Privacy Badger to ship with an updated pre-trained list will no longer include that domain in the list. Most Privacy Badger users will then update to that list. You can also unblock yourself by promising to meaningfully respect the Do Not Track signal.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this post I want to show how we can easily create a modal with vanilla JavaScript. It can have multiple open\/close handlers thanks to querySelectorAll. First of all lets create the HTML structure for our modal. Now lets add some style. Notice that 3 attributes on .modal class. It will keep the modal hidden &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[95],"tags":[],"class_list":{"0":"post-2089","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-95","7":"anons"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v24.9 (Yoast SEO v24.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Vanilla JavaScript Modal With Multiple Open\/close Handlers - datacenter<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"ru_RU\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Vanilla JavaScript Modal With Multiple Open\/close Handlers\" \/>\n<meta property=\"og:description\" content=\"In this post I want to show how we can easily create a modal with vanilla JavaScript. It can have multiple open\/close handlers thanks to querySelectorAll. First of all lets create the HTML structure for our modal. Now lets add some style. Notice that 3 attributes on .modal class. It will keep the modal hidden ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/casinodatacenter.ru\/?p=2089\" \/>\n<meta property=\"og:site_name\" content=\"datacenter\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-30T17:28:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-04T09:41:23+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u043c\u0438\u043d\u0443\u0442\u044b\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/casinodatacenter.ru\/?p=2089\",\"url\":\"https:\/\/casinodatacenter.ru\/?p=2089\",\"name\":\"Vanilla JavaScript Modal With Multiple Open\/close Handlers - datacenter\",\"isPartOf\":{\"@id\":\"https:\/\/casinodatacenter.ru\/#website\"},\"datePublished\":\"2024-10-30T17:28:03+00:00\",\"dateModified\":\"2024-11-04T09:41:23+00:00\",\"author\":{\"@id\":\"https:\/\/casinodatacenter.ru\/#\/schema\/person\/7725302c7a463aec5243942e0ea6f1cc\"},\"breadcrumb\":{\"@id\":\"https:\/\/casinodatacenter.ru\/?p=2089#breadcrumb\"},\"inLanguage\":\"ru-RU\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/casinodatacenter.ru\/?p=2089\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/casinodatacenter.ru\/?p=2089#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\",\"item\":\"https:\/\/casinodatacenter.ru\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Vanilla JavaScript Modal With Multiple Open\/close Handlers\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/casinodatacenter.ru\/#website\",\"url\":\"https:\/\/casinodatacenter.ru\/\",\"name\":\"datacenter\",\"description\":\"Just another WordPress site\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/casinodatacenter.ru\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ru-RU\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/casinodatacenter.ru\/#\/schema\/person\/7725302c7a463aec5243942e0ea6f1cc\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ru-RU\",\"@id\":\"https:\/\/casinodatacenter.ru\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8d06f386dca460091c1c9ffb220200bd?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8d06f386dca460091c1c9ffb220200bd?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"url\":\"https:\/\/casinodatacenter.ru\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Vanilla JavaScript Modal With Multiple Open\/close Handlers - datacenter","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"ru_RU","og_type":"article","og_title":"Vanilla JavaScript Modal With Multiple Open\/close Handlers","og_description":"In this post I want to show how we can easily create a modal with vanilla JavaScript. It can have multiple open\/close handlers thanks to querySelectorAll. First of all lets create the HTML structure for our modal. Now lets add some style. Notice that 3 attributes on .modal class. It will keep the modal hidden ...","og_url":"https:\/\/casinodatacenter.ru\/?p=2089","og_site_name":"datacenter","article_published_time":"2024-10-30T17:28:03+00:00","article_modified_time":"2024-11-04T09:41:23+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c":"admin","\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f":"4 \u043c\u0438\u043d\u0443\u0442\u044b"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/casinodatacenter.ru\/?p=2089","url":"https:\/\/casinodatacenter.ru\/?p=2089","name":"Vanilla JavaScript Modal With Multiple Open\/close Handlers - datacenter","isPartOf":{"@id":"https:\/\/casinodatacenter.ru\/#website"},"datePublished":"2024-10-30T17:28:03+00:00","dateModified":"2024-11-04T09:41:23+00:00","author":{"@id":"https:\/\/casinodatacenter.ru\/#\/schema\/person\/7725302c7a463aec5243942e0ea6f1cc"},"breadcrumb":{"@id":"https:\/\/casinodatacenter.ru\/?p=2089#breadcrumb"},"inLanguage":"ru-RU","potentialAction":[{"@type":"ReadAction","target":["https:\/\/casinodatacenter.ru\/?p=2089"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/casinodatacenter.ru\/?p=2089#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430","item":"https:\/\/casinodatacenter.ru\/"},{"@type":"ListItem","position":2,"name":"Vanilla JavaScript Modal With Multiple Open\/close Handlers"}]},{"@type":"WebSite","@id":"https:\/\/casinodatacenter.ru\/#website","url":"https:\/\/casinodatacenter.ru\/","name":"datacenter","description":"Just another WordPress site","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/casinodatacenter.ru\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ru-RU"},{"@type":"Person","@id":"https:\/\/casinodatacenter.ru\/#\/schema\/person\/7725302c7a463aec5243942e0ea6f1cc","name":"admin","image":{"@type":"ImageObject","inLanguage":"ru-RU","@id":"https:\/\/casinodatacenter.ru\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8d06f386dca460091c1c9ffb220200bd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8d06f386dca460091c1c9ffb220200bd?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/casinodatacenter.ru\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/casinodatacenter.ru\/index.php?rest_route=\/wp\/v2\/posts\/2089","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/casinodatacenter.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/casinodatacenter.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/casinodatacenter.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/casinodatacenter.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2089"}],"version-history":[{"count":1,"href":"https:\/\/casinodatacenter.ru\/index.php?rest_route=\/wp\/v2\/posts\/2089\/revisions"}],"predecessor-version":[{"id":2881,"href":"https:\/\/casinodatacenter.ru\/index.php?rest_route=\/wp\/v2\/posts\/2089\/revisions\/2881"}],"wp:attachment":[{"href":"https:\/\/casinodatacenter.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2089"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/casinodatacenter.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2089"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/casinodatacenter.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2089"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}