Bootstrap 3在iframe中,如何使响应菜单起作用



我在boostrap 3中有问题,当它在iframe内部时,响应菜单不起作用,如果起作用,则使用bootstrap 4,必须使用Bootstrap 3(索引(。HTML具有以下代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
  <meta name="description" content="ARCSA SERVICES PROTECTION, LLC">
  <title>ARCSA SERVICES PROTECTION, LLC | Credit Rating</title>
<style>
        iframe.menu {
            position: absolute;
            top:0;
            left: 0;
            width: 100vw;
            height: 100vh;
         }
         .mainContent {
           float:left;
           width:75%;
           height:80%;
         }    
</style>
</head>
<body>
    <iframe class="menu col-lg-12 col-md-12 col-sm-12" src="https://bootswatch.com/3/cyborg/"></iframe>
 </body>
</html>

,如果我更改为Bootstrap4,它运行良好,如何使Bootstrap3工作?

<!-- Thi is bootstrap4 -->
<iframe class="menu col-lg-12 col-md-12 col-sm-12" src="https://bootswatch.com/cyborg/"></iframe>

我解决此问题的解决方案:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="jquery.responsiveiframe.js"></script>
<script type='text/javascript'>
$(function() {
  $('iframe').responsiveIframe({xdomain: '*'});
});
</script>
<style>
body {
  margin: 0;
    width: 100vw;
    height: 100vh;
}
iframe {
    width: 100vw;
    height: 100vh;
    border: none;
}
</style>
</head>
<body>
    <iframe class="" src="https://bootswatch.com/3/cyborg/"></iframe>
 </body>
</html>

最新更新