Monday, 4 July 2016

show modal using jquery without button click

Bootstrap has a few functions that can be called manually on modals:

$('#myModal').modal('toggle');
$('#myModal').modal('show');
$('#myModal').modal('hide');

You can see more here: Bootstrap modal component
Specifically the methods section.

So you would need to change:
 
$('#my-modal').modal({
    show: 'false'
}); 

to:
 
$('#myModal').modal('show'); 

No comments:

Post a Comment

Git merge branch to another branch

$ git checkout develop $ git pull $ git checkout test-branch $ git merge develop $ git push