html - After closing once and reopening, css modal cannot be dismissed -
this code using auto popup css modal. problem when auto popup comes on second time on same page, cannot close clicking close button. there way close clicking on background ? if yes code should add ? thanks.
<div class="popup-wrapper" id="popup"> <div class="popup-container"> <!-- konten popup, silahkan ganti sesuai kebutuhan --> <form action="http://www.syakirurohman.net/2015/01/tutorial-membuat-popup-tanpa-javascript-jquery.html#" method="post" class="popup-form"> <h2>ikuti update !!</h2> <p>daripada hanya melihat demo untuk popup-nya saja, lebih baik masukkan juga email anda agar mendapatkan pemberitahuan saat ada update posting menarik lain seperti ini.<br/> <strong>percayalah, saya hanya akan mengirim sesuatu yang bermanfaat untuk anda :)</strong> </p> <div class="input-group"> <p><input type="email" name="email" placeholder="email address"></p> <p> <input type="hidden" name="action" value="subscribe"> <input type="hidden" name="source" value="http://www.syakirurohman.net/2015/01/tutorial-membuat-popup-tanpa-javascript-jquery.html"> <input type="hidden" name="sub-type" value="widget"> <input type="hidden" name="redirect_fragment" value="blog_subscription-2"> <input type="hidden" id="_wpnonce" name="_wpnonce" value="aaf0b68fcd"> <input type="submit" value="submit" name="jetpack_subscriptions_widget"> </p> </div> </form> <!-- konten popup sampai disini--><a class="popup-close" href="#popup">x</a> </div> </div>
the css
/* style untuk link popup */ a.popup-link { padding: 17px 0; text-align: center; margin: 10% auto; position: relative; width: 300px; color: #fff; text-decoration: none; background-color: #ffba00; border-radius: 3px; box-shadow: 0 5px 0px 0px #eea900; display: block; } a.popup-link:hover { background-color: #ff9900; box-shadow: 0 3px 0px 0px #eea900; -webkit-transition: 1s; transition: 1s; } /* end link popup*/ /* animasi popup */ @-webkit-keyframes autopopup { { opacity: 0; margin-top: -200px; } { opacity: 1; } } @-moz-keyframes autopopup { { opacity: 0; margin-top: -200px; } { opacity: 1; } } @keyframes autopopup { { opacity: 0; margin-top: -200px; } { opacity: 1; } } /* end animasi popup */ /*style untuk popup */ #popup { background-color: rgba(0, 0, 0, 0.7); position: fixed; top: 0; left: 0; right: 0; bottom: 0; margin: 0; -webkit-animation: autopopup 2s; -moz-animation: autopopup 2s; animation: autopopup 2s; } #popup:target { -webkit-transition: 1s; -moz-transition: 1s; transition: 1s; opacity: 0; visibility: hidden; } @media (min-width: 768px) { .popup-container { width: 600px; } } @media (max-width: 767px) { .popup-container { width: 100%; } } .popup-container { position: relative; margin: 7% auto; padding: 30px 50px; background-color: #fafafa; color: #333; border-radius: 3px; } a.popup-close { position: absolute; top: 3px; right: 3px; background-color: #333; padding: 7px 10px; font-size: 20px; text-decoration: none; line-height: 1; color: #fff; } /* end style popup */ /* style untuk isi popup */ .popup-form { margin: 10px auto; } .popup-form h2 { margin-bottom: 5px; font-size: 37px; text-transform: uppercase; } .popup-form .input-group { margin: 10px auto; } .popup-form .input-group input { padding: 17px; text-align: center; margin-bottom: 10px; border-radius: 3px; font-size: 16px; display: block; width: 100%; } .popup-form .input-group input:focus { outline-color: #fb8833; } .popup-form .input-group input[type="email"] { border: 0px; position: relative; } .popup-form .input-group input[type="submit"] { background-color: #fb8833; color: #fff; border: 0; cursor: pointer; } .popup-form .input-group input[type="submit"]:focus { box-shadow: inset 0 3px 7px 3px #ea7722; } /* end style isi popup */
Comments
Post a Comment