Find the solution to manually close the bootstrap modal box on the internet, say yes (need to refer to bootstrap.js, etc.):
$ ("#myModal"). Modal (' hide ');
But I found that I could only close
,
You cannot close the translucent layer below. Finding the next discovery is the reason for these two lines of code.
<class= "Modal-backdrop fade in"></div> < class= "Modal-backdrop fade in"></div>
So, I used a stupid way to add a class to the CSS
. Yincang {display:none;}
Then in JS, add a line of code:
$ (". Modal-backdrop"). AddClass ("Yincang");
So for the manual shutdown of the bootstrap modal box, my current solution is
<style>. Yincang{Display:None;}</style><Script> $("#myModal"). Modal ('Hide'); $(". Modal-backdrop"). addclass ("Yincang");</Script>
But there's a little bit of a problem. When I click "Close", the two <div> is gone, but now I change, when I click "Call to Action", there is still a <div>
<class= "Modal-backdrop fade in Yincang"></div>
We'll improve it later.
About manually closing the bootstrap modal frame