Twitter bootstrap 3 如何以引导模式从java脚本打开html页面?
我正在开发一个chrome扩展,希望在同一页面上从内容脚本打开一个HTML页面作为引导模式。怎么可能呢?你的答案有点含糊不清,你没有提供任何不是最好的代码 但您可以使用 你的模态体中会有类似Twitter bootstrap 3 如何以引导模式从java脚本打开html页面?,twitter-bootstrap-3,google-chrome-extension,content-script,Twitter Bootstrap 3,Google Chrome Extension,Content Script,我正在开发一个chrome扩展,希望在同一页面上从内容脚本打开一个HTML页面作为引导模式。怎么可能呢?你的答案有点含糊不清,你没有提供任何不是最好的代码 但您可以使用 你的模态体中会有类似的东西 你需要的所有信息都在那个网站上。但您可能需要更新一些CSS以使其看起来更好。我创建了一个带有可滚动iframe的全屏模式,当模式激活时,身体滚动功能被禁用,并且当模式关闭滚动被启用时。我希望这会有所帮助。:) 使用IFRAME打开模态 版权及副本;2017 Ace &时代; 情态标题 接近 保存更改
的东西
你需要的所有信息都在那个网站上。但您可能需要更新一些CSS以使其看起来更好。我创建了一个带有可滚动iframe的全屏模式,当模式激活时,身体滚动功能被禁用,并且当模式关闭滚动被启用时。我希望这会有所帮助。:)
使用IFRAME打开模态
版权及副本;2017 Ace
&时代;
情态标题
接近
保存更改
.模态对话框{
宽度:100%;
身高:100%;
保证金:0;
填充:0;
}
.模态内容{
高度:自动;
最小高度:100%;
边界半径:0;
}
.模态体{
高度:500px;
最小高度:100%;
}
函数disablebodyscroll(){
document.getElementById(“mybody”).style.overflow=“hidden”;
}
函数enablebodyscroll(){
document.getElementById(“mybody”).style.overflow=“自动”;
}
若要进入主题,请显示尝试(代码)和特定问题。可能的答案太多,或者好的答案对于这种格式来说太长。请在问题中添加详细信息,以缩小答案集或隔离可以在几个段落中回答的问题。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body id="mybody">
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary btn-lg " data-toggle="modal" data-target="#myModal" onclick="disablebodyscroll()"> OOPEN A MODAL WITH IFRAME</button>
<div style="background-color: black; height: 800px;"></div>
<p>Copyright © 2017 Ace</p>
<!-- End of button trigger modal -->
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close" onclick="enablebodyscroll()"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
<iframe src="https://www.w3schools.com/" style="border:0px #ffffff none;" name="myiFrame" scrolling="yes" frameborder="1" marginheight="0px" marginwidth="0px" width="100%" height="100%" position="absolute" allowfullscreen></iframe>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
</body>
</html>
<style type="text/css">
.modal-dialog {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
.modal-content {
height: auto;
min-height: 100%;
border-radius: 0;
}
.modal-body {
height: 500px;
min-height: 100%;
}
</style>
<script type="text/javascript">
function disablebodyscroll() {
document.getElementById("mybody").style.overflow = "hidden";
}
function enablebodyscroll() {
document.getElementById("mybody").style.overflow = "auto";
}
</script>