当我缩小浏览器时,可以看到移动切换,但是当我点击它时,它不会展开。我无法弄清楚为什么会这样。
<nav class="navbar-default navbar-fixed-top" role="navigation">
<div id="navbar">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-menubuilder"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button>
</div>
<div class="collapse navbar-collapse navbar-menubuilder">
<ul class="nav navbar-right nav-pills">
<li class="dropdown"><a data-toggle="dropdown" class="dropdown-toggle" href="#portfolio">1 <b class="caret"></b></a>
<ul class="dropdown-menu " id="prtf">
<li><a href="#">1.1</a></li>
<li><a href="#">1.2</a></li>
<li><a href="#">1.3</a></li>
</ul>
</li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
</ul>
</div>
</div>
</div>
</nav>
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<!-- bootstrap -->
<script src="bootstrap3/js/bootstrap.min.js"></script>
答案 0 :(得分:1)
我将你的导航栏部分复制粘贴到jsfiddle,它似乎正常工作。我想可能是你的js文件路径不正确。
jsFiddle:https://jsfiddle.net/AndrewL32/LrLffj2m/1/
请替换此行:
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
有了这个:
def scores():
#This is where all the scores are written
file = open("test.txt", "w")
file.write("Mary 200")
file.write("\nJohn 500")
file.write("\nAlex 300")
file.close()
#The content is now read from the file and split line by line
file = open("test.txt", "r")
content = file.read()
content = content.split("\n").
scoresList = []
for i in content:
name, score = i.split(" ")
scoresList.append(eval(score))
maxscore = max(scoresList)