Bootstrap 3 navbar on pages containing iframes

邮差的信 提交于 2019-12-10 14:56:02

问题


I have an issue with my navbar on bootstrap 3. When adding an iframe onto the page it won't expand and I cannot navigate (on small screens). Maximizing the window (big screens) however shows, that the navbar is there and all items are available and clickable.

Without the iframe, everything works as expected. Can anyone imagine, why? This seems rather strange to me...

I'd appreciate any pointers.

Cheers :-)

Edit: Some code. Don't get confused by the django code fragements inside the html. They are working fine.

Edit2: I also noticed now my footer isn't showing on that same page containing the iframe. commenting out the iframe and everything works. Why would that be? Noone?

iframe:

<div class="col-md-4">                                                              
  <iframe frameBorder="0", width="100%", height="500", id=generic src="generic_order.html"/>                                                                                          
</div>

navbar:

<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="index.html">Camerata Serena</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse navbar-ex1-collapse">
            <ul class="nav navbar-nav navbar-right">
                {% for page in page_list %}
                    {% if page.titel != 'Kasse' %}
                        <li><a href="generic_page.html?index={{ page.page_index }}">{{ page.titel }}</a></li>
                    {% endif %}
                {% endfor %} 
                <li><a href="admin/">Intern</a></li>                    
            </ul>
        </div>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container -->
</nav>

回答1:


I found the issue.

One has to use

<div class="col-md-4">                                                              
  <iframe frameBorder="0", width="100%", height="500", id=generic src="generic_order.html"></iframe>                                                                                          
</div>

with the complete closing statement. It's not enough to use

<div class="col-md-4">                                                              
  <iframe frameBorder="0", width="100%", height="500", id=generic src="generic_order.html"/>                                                                                          
</div>


来源:https://stackoverflow.com/questions/25866189/bootstrap-3-navbar-on-pages-containing-iframes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!