gpt4 book ai didi

c# - Bootstrap Tabdrop 在 MVC cshtml 中不起作用

转载 作者:太空宇宙 更新时间:2023-11-03 13:13:10 25 4
gpt4 key购买 nike

我有一个 mvc razor 页面 (cshtml),我试图在其中实现 bootstrp tabdrop。我能够获取选项卡,但不显示选项卡。当我在 html 文件中运行相同的代码时,我能够获得选项卡以及包含我的额外选项卡名称的 tabdrop。然而,当我在 cshtml 文件中运行代码时,它没有显示。

额外的选项卡显示在第二行,tabdrop 也没有显示。

Tabdrops Source

这是我的 cshtml 文件的完整代码,我在其中使用了 tabdrop.js...

<script src="Content/js/jquery-1.11.2.js"></script>
<script src="Content/js/bootstrap-tab.js"></script>
<script src="Content/js/bootstrap-tabdrop.js"></script>
<script src="Content/js/bootstrap-dropdown.js"></script>
<script>
if (top.location != location) {
top.location.href = document.location.href;
}
$(function () {
window.prettyPrint && prettyPrint();
$('.nav-tabs:first').tabdrop();
$('.nav-tabs:last').tabdrop({ text: 'More options' });
$('.nav-pills').tabdrop({ text: 'With pills' });
});
</script>
<link href="~/Content/css/bootstrap-tabdrop.css" rel="stylesheet" />
<div>
<div class="wrapper row-offcanvas row-offcanvas-left">
<!-- Left side column. contains the logo and sidebar -->
<!-- Right side column. Contains the navbar and content of the page -->
<aside class="right-side">
<!-- Main row -->
<div class="row">
<!-- Left col -->
<section class="col-lg-6 connectedSortable">
<!-- Box (with bar chart) -->
<div id="loading-example">
<div class="box-body no-padding">
<div class="row">
<div class="col-sm-7">
</div>
</div>
</div>
</div>
</section>
</div>
<section class="content">
<ul class="nav nav-tabs tabs-example" role="tablist">
<li class="active"><a href="#tabs-tab1" role="tab" data-toggle="tab">Tab 1</a></li>
<li><a href="#tabs-tab2" role="tab" data-toggle="tab">Tab 2</a></li>
<li><a href="#tabs-tab3" role="tab" data-toggle="tab">Tab 3</a></li>
<li><a href="#tabs-tab4" role="tab" data-toggle="tab">Tab 4</a></li>
<li><a href="#tabs-tab5" role="tab" data-toggle="tab">Tab 5</a></li>
<li><a href="#tabs-tab6" role="tab" data-toggle="tab">Tab 6</a></li>
<li><a href="#tabs-tab7" role="tab" data-toggle="tab">Tab 7</a></li>
<li><a href="#tabs-tab8" role="tab" data-toggle="tab">Tab 8</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tabs-tab1">
<p>This is tab 1!</p>

</div>
<div class="tab-pane" id="tabs-tab2">
<p>This is tab 2!</p>

</div>
<div class="tab-pane" id="tabs-tab3">
<p>This is tab 3!</p>

</div>
<div class="tab-pane" id="tabs-tab4">
<p>This is tab 4!</p>

</div>
<div class="tab-pane" id="tabs-tab5">
<p>This is tab 5!</p>

</div>
<div class="tab-pane" id="tabs-tab6">
<p>This is tab 6!</p>

</div>
<div class="tab-pane" id="tabs-tab7">
<p>This is tab 7!</p>

</div>
<div class="tab-pane" id="tabs-tab8">
<p>This is tab 8!</p>

</div>
</div>

<!-- top row -->
<!-- /.row -->
</section><!-- /.content -->
</aside>
</div>
</div>

我把css文件存放在这个位置

Content\css

和 Javascript 文件存储在该位置

Content\js

cshtml 文件具有 ADMINLTE bootstrap 的 Bootstrap 主题。

谁能帮我解决这个问题?我想知道 bootstrap tabdrops 是否适用于 cshtml 文件?

最佳答案

我有同样的问题。 tabdrop 插件在窗口调整大小时初始化。

我通过在 init tabdrop 后调整窗口大小解决了这个问题。

$(window).resize();

关于c# - Bootstrap Tabdrop 在 MVC cshtml 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27580815/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com