bootstrap调用iframe

var frameSrc = "http://www.devtoutiao.com/";

$('#openBtn').click(function(){     
	$('#myModal').on('show', function () {
		$('iframe').attr("src",frameSrc);        
	});
	$('#myModal').modal({show:true}) 
});
<a id="openBtn" href="#">Open modal</a>

<div id="myModal" role="dialog" tabIndex="-1">  
	<div>   
		<button class="close" type="button" data-dismiss="modal">×</button>    
		<h3>Dialog</h3>  
	</div>  
	<div class="modal-body">       
		<iframe style="zoom: 0.6;" height="250" src="" frameBorder="0" width="99.6%"></iframe>  
	</div>  
	<div>   
		<button data-dismiss="modal">OK</button>  
	</div> 
</div>

演示

演示

原文链接:bootstrap调用iframe 版权所有,转载时请注明出处,违者必究。
注明出处格式:前端开发博客 (http://caibaojian.com/bootstrap-iframe.html)

发表评论

请登录后发表评论: