-1

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?

Guilherme Freire
  • 372
  • 5
  • 17

1 Answers1

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

Community
  • 1
  • 1
Mohd Aman
  • 224
  • 1
  • 3
  • 13