fat*_*sma 16 html modal-dialog spinner twitter-bootstrap twitter-bootstrap-3
我试图在spinstrap 3模态中显示和居中spin.js微调器.使用下面的代码我可以在IE和FF中使用它,但不能在Chrome,Safari桌面,Chrome IOS,Safari IOS中使用.
这个问题似乎与动画中的淡入淡出(灰色背景叠加)有关,因为当我将模态类设置为"模态显示"时,它可以工作,但当然没有动画淡入淡出.看到这个jsfiddle.当我使用"$('#Searching_Modal").modal('show');"它在上述某些浏览器中不起作用时.
在chrome和firefox上运行这个jsfiddle你会明白我的意思.有人知道如何解决这个问题或者做得对吗?我确实希望bootstrap模式淡入功能.
我正在使用Bootstrap 3和spin.js.
<div id="Searching_Modal" class="modal fade" tabindex="-1" role="dialog" data-keyboard="false"
data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" style="text-align: center">
<h3>Searching for Seats</h3>
</div>
<div class="modal-body">
<br>
<br>
<br>
<div id="searching_spinner_center" style="position:fixed; left:50%"></div>
<br>
<br>
<br>
</div>
<div class="modal-footer" style="text-align: center"></div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
这是spin.js设置代码:
var opts = {
lines: 13, // The number of lines to draw
length: 20, // The length of each line
width: 10, // The line thickness
radius: 30, // The radius of the inner circle
corners: 1, // Corner roundness (0..1)
rotate: 0, // The rotation offset
direction: 1, // 1: clockwise, -1: counterclockwise
color: '#000', // #rgb or #rrggbb or array of colors
speed: 1, // Rounds per second
trail: 60, // Afterglow percentage
shadow: false, // Whether to render a shadow
hwaccel: false, // Whether to use hardware acceleration
className: 'spinner', // The CSS class to assign to the spinner
zIndex: 2e9, // The z-index (defaults to 2000000000)
top: 'auto', // Top position relative to parent in px
left:'auto' // Left position relative to parent in px
};
//var target = document.getElementById('center_spinner');
var target = document.getElementById('searching_spinner_center');
var spinner = new Spinner(opts).spin(target);
Run Code Online (Sandbox Code Playgroud)
use*_*rfb 24
尝试替换div.modal-body
<div class="modal-body" >
<div style="height:200px">
<span id="searching_spinner_center" style="position: absolute;display: block;top: 50%;left: 50%;"></span>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
为我工作.http://jsfiddle.net/D6rD6/5/