CodePen
codepen.io โบ lovol2 โบ pen โบ yxMJxG
Simple Jquery Popup/Modal
$('.open-popup').on('click', function() { openpopupnow(); }); $('.popup-close').on('click', function() { $('.overlay').removeClass('shown'); }); $('.btn_yes').on('click', function() { $('.overlay').removeClass('shown'); }); $(document).on('keyup', ...
Videos
04:19
Jquery Modal Popup| New Way to Open Modal Popup Using Jquery On ...
04:31
Jquery Modal Popup || Open Modal Popup Using Jquery On Button Click ...
04:05
How to open bootstrap modal popup on button click in asp net c# ...
09:27
bootstrap modal popup on button click jquery | bootstrap modal ...
How to Open Modal Popup using jQuery on Button Click ...
07:59
How to open modal on page load using jQuery || Show modal popup ...
CodePen
codepen.io โบ kelvinangulo โบ pen โบ ybzqze
Open modal with jQuery on('click'
$('#mainHeader').before($( '<div class="modalContainer">' + '<div class="modalContent">' + '<div class="heading">HELLO WORLD</div>' + '<div class="close_btn">×</div>' + '<div class="text1">Here is a simple modal.</div>' + '</div>' + '</div>' ).fadeIn()); $('.close_btn').on('click', function(){ $('.modalContainer').remove(); }) } $('.openModalButton').on('click', function(){ openModalFunction(); })
CodePen
codepen.io โบ jeffleulier โบ pen โบ VOepLd
Jquery Modal
<!-- Remember to include jQuery :) --> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script> <!-- jQuery Modal --> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.1/jquery.modal.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.1/jquery.modal.min.css" /> <!-- By default link takes user to /login.html --> <a href="" data-modal="#login-modal">Login</a> <!-- Login modal embedded in page --> <div id="login-modal" class="modal"> ... </div> ... $(function() { $('a[data-modal]').on('click', function() { $($(this).data('modal')).modal({ fadeDuration: 250 }); return false; }); });
CodePen
codepen.io โบ ud-kazi โบ pen โบ BaNJzpY
How to open modal on page load using jquery
<!doctype html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <!-- Bootstrap CSS --> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> <title>Hello, world!</title> </head> <body> <h1 style="text-align: center;">Hello, world!</h1> <!-- Button trigger modal --> <!-- Modal --> <div class="modal fade" id="exampleModal" tabin
CodePen
codepen.io โบ drmikeh โบ pen โบ ZOMEYJ
jQuery Dynamic Modal
<div class="bs-example"> <!-- Button HTML (to Trigger Modal) --> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal" data-num="0">Question 1</button> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal" data-num="1">Question 2</button> <!-- Modal HTML --> <div id="myModal" class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">ร</button> <h4 class="modal-title">Modal Window</h4> </div> <div class="modal-body"> </div> <div class="modal-footer"> <button type="button" class="btn btn-primary" class="close" data-dismiss="modal" onclick="submit()">Submit</button> </div> </div> </div> </div> <hr/> <h4 id="selected"></h4> </div>
CodePen
codepen.io โบ kiyara โบ pen โบ maeGKp
modal popup on click
$(document).ready(function() { $(".open").click(function () { $(".modalDialog1").modal("show"); }); $(".thanks-btn1").on('click',function(){ $(".modalDialog1").css("display","none"); }); $(".close1").on('click',function(){ $(".modalDialog1").css("display","none"); }); $(".modal-backdrop1").click(function () { $(".modalDialog1").css("display","none"); }); });
CodePen
codepen.io โบ ariwinokur โบ pen โบ vGzELM
Super Simple Modal Popups with jQuery and CSS3 Transitions
$(function() { var appendthis = ("<div class='modal-overlay js-modal-close'></div>"); $("a[data-modal-id]").click(function(e) { e.preventDefault(); $("body").append(appendthis); $(".modal-overlay").fadeTo(500, 0.7); //$(".js-modalbox").fadeIn(500); var modalBox = $(this).attr('data-modal-id'); $("#" + modalBox).fadeIn($(this).data()); }); $(".js-modal-close, .modal-overlay").click(function() { $(".modal-box, .modal-overlay").fadeOut(500, function() { $(".modal-overlay").remove(); }); }); $(window).resize(function() { $(".modal-box").css({ top: ($(window).height() - $(".modal-box").outerHeight()) / 2, left: ($(window).width() - $(".modal-box").outerWidth()) / 2 }); }); $(window).resize(); });
CodePen
codepen.io โบ D-B-M โบ pen โบ poojYLd
simple jquery popup
// jQuery extend functions for popup (function($) { $.fn.openPopup = function( settings ) { var elem = $(this); // Establish our default settings var settings = $.extend({ anim: 'fade' }, settings); elem.show(); elem.find('.popup-content').addClass(settings.anim+'In'); } $.fn.closePopup = function( settings ) { var elem = $(this); // Establish our default settings var settings = $.extend({ anim: 'fade' }, settings); elem.find('.popup-content').removeClass(settings.anim+'In').addClass(settings.anim+'Out'); setTimeout(function(){ elem.hide(); elem.find('.popup-content').removeClass(settings.anim+'Out') }, 500); } }(jQuery)); // Click functions for popup $('.open-popup').click(function(){ $('#'+$(this).data('id')).openPopup({ anim: (!$(this).attr('data-animation') || $(this).data('animation') == null) ?
Top answer 1 of 4
11
show openModal div on button1 click.
$('#button1').on('click', function() {
$('#openModal').show();
});
No need of onclick="myFunction()" on button
2 of 4
3
Let's try...
Simple popup model created by using jquery, HTML, and CSS.
$(function() {
// Open Popup
$('[popup-open]').on('click', function() {
var popup_name = $(this).attr('popup-open');
$('[popup-name="' + popup_name + '"]').fadeIn(300);
});
// Close Popup
$('[popup-close]').on('click', function() {
var popup_name = $(this).attr('popup-close');
$('[popup-name="' + popup_name + '"]').fadeOut(300);
});
// Close Popup When Click Outside
$('.popup').on('click', function() {
var popup_name = $(this).find('[popup-close]').attr('popup-close');
$('[popup-name="' + popup_name + '"]').fadeOut(300);
}).children().click(function() {
return false;
});
});
body {
font-family:Arial, Helvetica, sans-serif;
}
p {
font-size: 16px;
line-height: 26px;
letter-spacing: 0.5px;
color: #484848;
}
/* Popup Open button */
.open-button{
color:#FFF;
background:#0066CC;
padding:10px;
text-decoration:none;
border:1px solid #0157ad;
border-radius:3px;
}
.open-button:hover{
background:#01478e;
}
.popup {
position:fixed;
top:0px;
left:0px;
background:rgba(0,0,0,0.75);
width:100%;
height:100%;
display:none;
}
/* Popup inner div */
.popup-content {
width: 500px;
margin: 0 auto;
box-sizing: border-box;
padding: 40px;
margin-top: 20px;
box-shadow: 0px 2px 6px rgba(0,0,0,1);
border-radius: 3px;
background: #fff;
position: relative;
}
/* Popup close button */
.close-button {
width: 25px;
height: 25px;
position: absolute;
top: -10px;
right: -10px;
border-radius: 20px;
background: rgba(0,0,0,0.8);
font-size: 20px;
text-align: center;
color: #fff;
text-decoration:none;
}
.close-button:hover {
background: rgba(0,0,0,1);
}
@media screen and (max-width: 720px) {
.popup-content {
width:90%;
}
}
<!DOCTYPE html>
<html>
<head>
<title> Popup </title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
</head>
<body>
<a class="open-button" popup-open="popup-1" href="javascript:void(0)"> Popup
Preview</a>
<div class="popup" popup-name="popup-1">
<div class="popup-content">
<h2>Model </h2>
<p>Model content will be here. Lorem ipsum dolor sit amet,
consectetur adipiscing elit. Aliquam consequat diam ut tortor
dignissim, vel accumsan libero venenatis. Nunc pretium volutpat
convallis. Integer at metus eget neque hendrerit vestibulum.
Aenean vel mattis purus. Fusce condimentum auctor tellus eget
ullamcorper. Vestibulum sagittis pharetra tellus mollis vestibulum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<a class="close-button" popup-close="popup-1" href="javascript:void(0)">x</a>
</div>
</div>
</body>
</html>
CodePen
codepen.io โบ akb20 โบ pen โบ waymXJ
Animated jQuery Modal Pop-up
If disabled, use the "Run" button to update. If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting. ... Visit your global Editor Settings. ... <head> <!-- Ionicons--> <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css"> </head> <body> <!--Overlay & Modal--> <div class="overlay"> <div class="modal"> <div class="close-btn"><i class="ion-close"></i> </div> <div class="text-box"> <p class="lead">Be sure to subscribe to receive awesome content, lollipops, and free Happy Meals!</p> <p class="tagline">In Your Spam Folder...
CodePen
codepen.io โบ tag โบ jquery-modal
Pens tagged 'jquery-modal' on CodePen
CodePen doesn't work very well without JavaScript ยท We're all for progressive enhancement, but CodePen is a bit unique in that it's all about writing and showing front end code, including JavaScript. It's required to use most of the features of CodePen ยท Need to know how to enable it?
CodePen
codepen.io โบ rajrs โบ pen โบ NNjbpE
open bootstrap model onclick
<div id="testmodal" class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">Confirmation</h4> </div> <div class="modal-body"> <p>Do you want to save changes you made to document before closing?</p> <p class="text-warning"><small>If you don't save, your changes will be lost.</small></p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn b
Zditect
zditect.com โบ blog โบ 2105770.html
Open modal popup using jQuery on button click CodePen,
A jQuery click event handler has been assigned to the Button. When the Button is clicked the jQuery UI Dialog Modal Popup is shown.
CodePen
codepen.io โบ EdWise โบ pen โบ gOOvGgw
Modal Pop-up with YouTube iframe and jQuery
$(document).ready(function() { // Watch More Link click handlers const $popup = $('.video-popup'); const $modal = $('#modal'); const $closeIcon = $('.close'); const $watchMoreLink = $('.watch-more'); $watchMoreLink.click(function(e) { $popup.fadeIn(200); $modal.fadeIn(200); e.preventDefault(); }); $closeIcon.click(function () { $popup.fadeOut(200); $modal.fadeOut(200); }); // for escape key $(document).on('keyup',function(e) { if (e.key === "Escape") { $popup.fadeOut(200); $modal.fadeOut(200); } }); // click outside of the popup, close it $modal.on('click', function(e){ $popup.fadeOut(200); $modal.fadeOut(200); }); });
CodePen
codepen.io โบ cdnievas โบ pen โบ XZRZPY
Responsive JQuery Popup
<div class="wrap"> <div class="intro"> <p><h1>Responsive JQuery Popup</h1></p> <p><i>"Full responsive popup with JQuery using a button to hide it."</i></p><br> <!-- Popup action --> <a onClick="openPopup('#wrap_popup1')">Open 1st Popup</a> | <a onClick="openPopup('#wrap_popup2')">Open 2nd Popup</a> </div> <!-- Popup --> <div id="wrap_popup1" class="wrap_popup"> <div class="popup"> <div class="title"> <p>Advert popup</p> </div> <div class="box"> <p>This is an example text of the 1st Popup.</p> <center><button onClick="closePopup('#wrap_popup1')">Close Popup</button></center> </div> </div> </div