注意是加到button元素:<button class="btn btn-primary" data-toggle="modal" data-target="#mymodal-data" data-backdrop="static" data-keyboard="false" type="button">通过data-target触发</button>
2017-07-16
最赞回答 / 相遇是缘_04342302
<script src="https://cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script> <script src="https://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
2017-06-30
Refused to load the script 'http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' 'unsafe-eval' *.imooc.com *.mukewang.com *.baidu.com *.sina.com.cn *.bootcss.com". 这个报错 服了
2017-06-28
<script>
$(function(){
$('.btn').on('click',function(){
$("#mymodal").modal({
keyboard:false,
backdrop:'static'
});
})
});
</script>
$(function(){
$('.btn').on('click',function(){
$("#mymodal").modal({
keyboard:false,
backdrop:'static'
});
})
});
</script>
2017-06-26
(function(){
$('.btn').on('click',function(){
$('#themodal').modal();
})
})();
$('.btn').on('click',function(){
$('#themodal').modal();
})
})();
2017-06-26
<script>
$(function(){
$('.btn').on('click',function(){
$('#themodal').modal();
})
})
</script>
$(function(){
$('.btn').on('click',function(){
$('#themodal').modal();
})
})
</script>
2017-06-26