我在使用Sinatra的bootstrap3中使用Darkly主题。我正在尝试使用bootstrap3实现选项卡。但是,制表符不会切换,即当我打开浏览器时只显示活动选项卡。当我点击“选项卡b”时,url会更改,但选项卡中的内容保持不变,选项卡不会切换到其他选项卡。请帮助。我应该包括任何引导油墨吗?这是我的Haml代码。Tabs不能在Bootstrap中切换3
!!!
%html{lang: "en"}
%head
%meta{charset: "utf-8"}/
%title Job Tracker
%meta{content: "width=device-width, initial-scale=1", name: "viewport"}/
%link{href: "./bootstrap.css", media: "screen", rel: "stylesheet"}/
%link{href: "../assets/css/bootswatch.min.css", rel: "stylesheet"}/
%link{:href=>"//netdna.bootstrapcdn.com/bootswatch/3.1.1/darkly/bootstrap.min.css", :rel=>"stylesheet"}
%link{href: "http://fonts.googleapis.com/css?family=Special+Elite", rel: "stylesheet", type: "text/css"}/
%link{href: "https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css"}
:css
.container {margin top :20px}
body {padding-top : 70px; font-size : 18px; text-align: justify; font-family: 'Special Elite', cursive; }
h1, h2, h3, h4, h5, h6 { text-align: center; font-family: 'Special Elite', cursive; }
:javascript
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-23019901-1']);
_gaq.push(['_setDomainName', "bootswatch.com"]);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
%body
.container
%ul#myTab.nav.nav-tabs{style: "margin-bottom: 30px;"}
%li.active
%a{ href: "#a"} a
%li
%a{ href: "#b"} b
%li
%a{ href: "#c"} c
%li
%a{ href: "#d"} d
.tab-content
#a.tab-pane.fade.active.in
%p Tab a
#b.tab-pane.fade.in
%p Tab b
#c.tab-pane.fade.in
%p Tab c
#d.tab-pane.fade.in
%p Tab d
%script{src: "public/js/bootstrap.min.js"}
你好。我看到你对这个网站是陌生的,所以为了坚持这里惯常的做法,我认为你应该把这个代码作为一个钼(通过编辑)添加到你的原始问题中,然后将@ AceWebDesign的答案标记为正确。 – iain