I want create a loading modal while a big function dosen't finish, this modal cant be close while this function dosen't finish, how i can do that?
Asked
Active
Viewed 121 times
1 Answers
1
You should explain little more to your question for better understanding. I think go through my given link you will get your answer for your question
Link here: loading model
visit this link
How to use bpopup
« Basic example that will bind a click event which will trigger bPopup when fired. Add a reference to the jquery core lib (newer than 1.3.x) and bPopup. Please don’t hotlink to bPopup:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/x.x.x/jquery.min.js"></script>
<script src="jquery.bpopup-x.x.x.min.js"></script>
Markup: Add a button + an element to pop up.
<html>
<head> ... </head>
<body>
...
<!-- Button that triggers the popup -->
<button id="my-button">POP IT UP</button>
<!-- Element to pop up -->
<div id="element_to_pop_up">Content of popup</div>
...
</body>
</html>
CSS: Hide the element you want to pop up on page load.
<style>
#element_to_pop_up { display:none; }
</style>
The magic: Bind a click event on the button which will trigger the popup.
// Semicolon (;) to ensure closing of earlier scripting
// Encapsulation
// $ is assigned to jQuery
;(function($) {
// DOM Ready
$(function() {
// Binding a click event
// From jQuery v.1.7.0 use .on() instead of .bind()
$('#my-button').bind('click', function(e) {
// Prevents the default action to be triggered.
e.preventDefault();
// Triggering bPopup when click event is fired
$('#element_to_pop_up').bPopup();
});
});
})(jQuery);
OR
;(function($) {
$(function() {
$('#my-button').bind('click', function(e) {
e.preventDefault();
$('#element_to_pop_up').bPopup({
appendTo: 'form'
, zIndex: 2
, modalClose: false
});
});
});
})(jQuery);
Link For Demo Link here
-
This should be a comment, not an answer. – Rory McCrossan Jan 18 '17 at 11:41
-
@RoryMcCrossan i am writing code for it. but you marked it wrong – Mohd Aman Jan 18 '17 at 11:43
-
I don't know what you mean? – Rory McCrossan Jan 18 '17 at 11:47
-
hey @RoryMcCrossan, i was writing code for this question. but you dislike my answer bro – Mohd Aman Jan 18 '17 at 11:48
-
Your answer has no dislikes...? – Rory McCrossan Jan 18 '17 at 11:49