user7151106
user7151106

Reputation:

Bootstrap modal call with javascript, best practice

First of all, I have 5 modals in layout.

  1. Loading
  2. Success
  3. Error
  4. Info
  5. Dialogue

And I am calling them like:

MessageBox.show('modaltype', 'message');

So my actual concern is, my function is sth like:

var MessageBox = function($,undefined) {

    return {
        show = function(type,message) {
        }
    }
}(jQuery)

Is this the right way to do so? Do you suggest sth more efficient?

Upvotes: 0

Views: 322

Answers (1)

Therichpost
Therichpost

Reputation: 1815

Here you can check the jquery btn click function call bootstrap modal:

$("#buttom id").click(function(event){
$("#modalboxid").modal('show');
});

Upvotes: 1

Related Questions