I have a button code which someone created it. Here are the button code:
<button class="demo btn btn-primary" data-toggle="modal" href="#long" onClick="javascript:add();"><i class="icon-plus-sign icon-white"></i> Add Employee</button>
I've edit the function related to the button (send the new data from the button, and call it in the function), but nothing happened. Then I tried to delete data-toggle="modal"
, the pop up didn't show. So, I wonder, what is data-toggle="modal"
use for?
I thought here are the link to modal:
<script src="js/bootstrap-modalmanager.js"></script>
<script src="js/bootstrap-modal.js"></script>
Can anyone explain me about data-toggle="modal"
? Thank you.
class = "modal-footer", is a CSS class of Bootstrap CSS to set style for footer of the modal window. data-toggle = "modal", HTML5 custom data attribute data-toggle is used to open the modal window.
toggle() simply shows and hides an element. Bootstrap's . modal() constructs a modal... not the same thing as simply toggling visibility.
Just add data-toggle="collapse" and a data-target to element to automatically assign control of a collapsible element. The data-target attribute accepts a CSS selector to apply the collapse to. Be sure to add the class collapse to the collapsible element. If you'd like it to default open, add the additional class in.
From the Bootstrap Docs
<!--Activate a modal without writing JavaScript. Set data-toggle="modal" on a
controller element, like a button, along with a data-target="#foo" or href="#foo"
to target a specific modal to toggle.-->
<button type="button" data-toggle="modal" data-target="#myModal">Launch modal</button>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With