Tag: bootstrap tabs

在ASP.NET MVC中选择“页面加载时选项卡”

我在Razor页面上有两个标签,我希望能够加载页面并选择页面A或B.目前,页面加载并始终登陆A.我试图按照以下方式执行此操作… 在我的主页视图中,我调用了我的产品视图 Learn More 我传递路由值“productB”,所以我可以尝试加载选项卡。 在我的产品控制器中我有 public ActionResult Index(object id = null) { if (id != null && !String.IsNullOrEmpty()) ViewBag.ActiveTab = id.ToString(); return View(); } 产品视图 @{ string activeTab = ViewBag.ActiveTab; } productA productB … … 与function $(function () { var selector = ‘@activeTab’; $(“#” + selector).addClass(“active”); // Also tried the following… // var anchor […]

转到页面重新加载或超链接上的特定选项卡,其中选项卡由AJAX加载

我有一组Bootstrap选项卡。 HTML Main User Info … … JS var url = document.location.toString(); if (url.match(‘#’)) { $(‘.nav-tabs a[href=#’ + url.split(‘#’)[1] + ‘]’).tab(‘show’); } // Change hash for page-reload $(‘.nav-tabs a’).on(‘shown’, function (e) { window.location.hash = e.target.hash; }) // load first tab content if it is AJAX $(‘#main’).load($(‘a[data-url]:first’).attr(“data-url”) + “&silent=1”, function (data) { $(‘.active a’).tab(‘show’); }); 我想要的是对于任何选项卡有焦点加载,而不是总是加载第一个。 […]

如何在引导程序选项卡中添加关闭图标?

我想在引导选项卡中添加一个关闭图标,然后我可以通过单击图标关闭选项卡。 我尝试下面,但“X”显示不与标题标题在同一行。 .close { font-size: 20px; font-weight: bold; line-height: 18px; color: #000000; text-shadow: 0 1px 0 #ffffff; opacity: 0.2; filter: alpha(opacity=20); text-decoration: none; display:inline; } .close:hover { display:inline; color: #000000; text-decoration: none; opacity: 0.4; filter: alpha(opacity=40); cursor: pointer; } The tab ×