bootstrap-modal

What's the tabindex=“-1” in bootstrap for

ⅰ亾dé卋堺 提交于 2019-11-27 11:44:42
What's the tabindex attribute in Bootstrap 3 for? Its documentation doesn't say anything about them although they use them practically in all modals. I've only find this regarding its use, which doesn't really say much Accessible tooltips for keyboard and assistive technology users For users navigating with a keyboard, and in particular users of assistive technologies, you should only add tooltips to keyboard-focusable elements such as links, form controls, or any arbitrary element with a tabindex="0" attribute. And I found out I can't press esc to hide a modal if the tabindex attribute is not

How can I close a modal in Angular 2?

流过昼夜 提交于 2019-11-27 11:17:07
问题 I want user click the Submit button and the modal close automatically. If I add data-dismiss="modal" in the Submit <button> , it won't run submitComments() . I tried to do something like $('#myModal').modal('hide'); , but not succeed. So how can I close a modal in Angular 2? Thanks <button type="button" class="btn btn-info" data-toggle="modal" data-target="#myModal">Open Modal</button> <div id="myModal" class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <div class=

Twitter Bootstrap modal pushes html content to the left

别等时光非礼了梦想. 提交于 2019-11-27 10:26:34
问题 If I open a modal dialog, through Twitter Bootstrap, I've noticed that it pushes all the html content of the page (i.e., in the container ) to the left a little bit, and then puts it back to normal after closing itself. However, this only happens if the browser width is large enough to not be on the "mobile" (i.e., smallest) media query. This occurs with the latest versions of FF and Chrome (haven't tested other browsers). You can see the problem here: http://jsfiddle.net/jxX6A/2/ Note: You

Vertically centering Bootstrap modal window

三世轮回 提交于 2019-11-27 09:59:19
I would like to center my modal on the viewport (middle) I tried to add some css properties .modal { position: fixed; top:50%; left:50%; } I'm using this example http://jsfiddle.net/rniemeyer/Wjjnd/ I tried $("#MyModal").modal('show').css( { 'margin-top': function () { return -($(this).height() / 2); }, 'margin-left': function () { return -($(this).width() / 2); } }) This does the job : http://jsfiddle.net/sRmLV/1140/ It uses a helper-div and some custom css. No javascript or jQuery required. HTML (based on Bootstrap's demo-code ) <button class="btn btn-primary btn-lg" data-toggle="modal" data

How to send parameter json array when modal open?

旧城冷巷雨未停 提交于 2019-11-27 09:51:38
Demo and full code is like this : https://jsfiddle.net/xzxrp7nn/5/ My HTML code is like this : <div id="tes"> </div> <!-- Modal Currency--> <div class="modal fade" id="priceModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> </div> <div class="modal-body"> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </div> My Javascript code is like this :

Passing data via Modal Bootstrap and getting php variable?

百般思念 提交于 2019-11-27 09:20:39
I'm trying to get an input value passed via jquery and setting into a php variable, but I don't know how to do that. This button have the value that I want to send: <button type='button' data-a='".$fila['idPlaza']."' href='#editarUsuario' class='modalEditarUsuario btn btn-warning btn-xs' data-toggle='modal' data-backdrop='static' data-keyboard='false' title='Editar usuario'><img src='../images/edit.png' width='20px' height='20px'></button> Then I have this js code to send the value: $(document).on("click", ".modalEditarUsuario", function (e) { e.preventDefault(); var self = $(this); $("#a")

How to use code to open a modal in Angular 2?

时光总嘲笑我的痴心妄想 提交于 2019-11-27 05:40:45
问题 Usually we use data-target="#myModal" in the <button> to open a modal. Right now I need use codes to control when to open the modal. If I use [hidden] or *ngIf to show it, I need remove class="modal fade" , otherwise, the modal will never show. Like this: <div [hidden]="hideModal" id="myModal"> However, in this case, after removing class="modal fade" , the modal won't fade in and has no shade in the background. And what's worse, it will show at the screen bottom instead of screen center. Is

Angular 2 ng2-bootstrap modal inside child component called from parent component

佐手、 提交于 2019-11-27 05:13:10
Hard to explain this. I had a simple working ng2-bootstrap modal example working. I expanded it to include Boostrap 4 Jumbotron example template for my home page, now the ng2-bootstrap modal does nothing. I can see the this.childModal.show() in child modal component is getting called on the button click, but nothing happens. No error in Chrome console and no modal shows. I have no idea what to do next :-/ // ============================================================================ // /src/app/app.module.ts import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '

Bootstrap $('#myModal').modal('show') is not working

半世苍凉 提交于 2019-11-27 03:13:53
问题 I'm not sure why but all the modal functions are not working with me. I checked the version and the load they are fine. I keep getting this error message: Uncaught TypeError: $(...).modal is not a function for the hide I already found an alternative. instead of: $('#myModal').modal('hide'); I used this : $('#myModal .close').click(); And it works perfectly. The problem now is with the show $('#myModal').modal("show"); I also tried both $('#myModal').modal("toggle"); And: $('#myModal').modal()

How to correctly validate a modal form

邮差的信 提交于 2019-11-27 02:54:40
问题 I can't seem to get validation to work on my bootstrap modal, I have struggled with several of the examples that I have encountered. What is the correct way to validate a bootstrap modal? My HTML: <div class="modal fade" id="addMyModal" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">Add Stuff</h4> </div> <div class="modal-body"> <form class="form