I am using bootstrap-modal from :
modalEl is the modal element in DOM. Modal is pletely rendered in the with some dynamic content.
I want to hide the modal, do some work on application and would like to render that same modal later again without initialising the any new modal.
How do i do that???
I have removed data-dismiss="modal"
attribute from the button.
but the following not working in my case
$(modalEl).modal('hide');
$(modalEl).modal('show');
I am using bootstrap-modal from :
https://github./jschr/bootstrap-modal
modalEl is the modal element in DOM. Modal is pletely rendered in the with some dynamic content.
I want to hide the modal, do some work on application and would like to render that same modal later again without initialising the any new modal.
How do i do that???
I have removed data-dismiss="modal"
attribute from the button.
but the following not working in my case
$(modalEl).modal('hide');
$(modalEl).modal('show');
Share
Improve this question
edited Nov 30, 2013 at 7:39
codeofnode
asked Nov 30, 2013 at 7:28
codeofnodecodeofnode
18.7k30 gold badges88 silver badges146 bronze badges
2
- what do you mean by "not working"? What steps have you taken to debug the problem? – Stephen Thomas Commented Nov 30, 2013 at 14:45
- sorry i was using default approach of twitter bootstrap while using bootstrap-modal.js from different vender. – codeofnode Commented Nov 30, 2013 at 19:49
1 Answer
Reset to default 3'bootstrap-modal.js' provided from https://github./jschr/bootstrap-modal is at least little different if pared from the default modal provided from twitter bootstrap.
for the modal root div (here taken as modalEl)
to show hide default twitter bootstrap we use :
$(modalEl).modal(); // initialize
$(modalEl).modal('hide'); // hide
$(modalEl).modal('show'); //show
However if we use modal from https://github./jschr/bootstrap-modal we should use the following way :
var modalObj = $(modalEl).modal(); // initialize
modalObj.modal('hide') // to hide
modalObj.modal('show') // show