Tag: twitter bootstrap

在bootstrap导航栏中添加动态添加的navlinks

我是Bootstrap的新手,似乎无法解决这个问题,我将导航栏用作Bootstrap的javascript标签function,它可以动态添加和删除导航链接,我使用的是图像而不是默认的导航链接,我的问题是,当我添加动态导航链接时,它应该成为活动类并显示其相关内容,此时我必须单击以使其处于活动状态,如果我删除任何导航链接,内容保持不变,有没有办法实现这个function html是: Home 单击此按钮时会添加选项卡: li是使用添加的 var counter = 1; $(‘.plus’).click(function(e) { e.preventDefault(); var li_count = $(‘#nav-tabs’).find(“li.test”).length; if (li_count <= 3) if(counter <= 3){ $('#nav-tabs').append('Home×’); } else { alert(“Only 3 Tabs Allowed!”)}; 标签的内容后面添加类似; 选项卡中的活动类是使用切换的 $(“#nav-tabs”).on(“click”, “a”, function(e) { e.preventDefault(); $(this).tab(‘show’); $(‘li.test’).each(function() { if($(this).hasClass(‘active’)) { //Active class is applied $(this).children().children().closest(“img”).attr(“src”, “https://stackoverflow.com/questions/14907997/show-dynamically-added-navlinks-when-added-in-bootstrap-navbar/assets/img/button_home_selected3.png”); $(this).find(“button”).show(); } else { $(this).children().children().closest(“img”).attr(“src”, “assets/img/button_home_plain2.png”); […]

Twitter Bootstrap模式表单提交

我最近一直在使用twitter引导程序摆弄,使用java / jboss,我一直在尝试从Modal界面提交表单,表单只包含一个隐藏字段而没有其他任何显示等等都不重要。 表单是模态本身的外部,我无法弄清楚这是如何实现的 我尝试将模态本身添加到表单中,尝试使用HTML5 form =“form_list”,甚至将表单添加到模态体并使用一些jquery强制提交,但似乎没有任何工作 下面是我试图增加到我需要的示例模态,OK按钮之前编辑试图调用jquery函数。 × Delete Confirmation Are you sure you want to delete the user? “); Cancel Ok

在编辑超链接单击时将标签更改为文本框

我是ruby on rails和twitter bootstrap的新手。 如果我的问题听起来很愚蠢,请接受我的道歉。 我正在使用twitter bootstrap进行我的网站设计。 我一直在尝试使用bootstrap将标签更改为使用超链接按钮单击的文本框。 Saghir Edit 但我无法这样做,我应该使用jquery这样做,或者我可以使用bootstrap。 请指出正确的方向。 提前致谢 编辑代码使用超链接更新(它也可以是按钮)。 就像,当我点击“编辑”超链接时,我的标签应该显示可以使用bootstrap的占位符属性使用的内容“Saghir”。 我可以提交表单来更新数据库的值。

动态构建Twitter Bootstrap模式

我正在构建一个Rails应用程序,我想通过AJAX将Rails部分内容放入模态中。 在Twitter Bootstrap 2.3.2模式中,我通过文档阅读您可以使用远程密钥通过ajax加载内容。 http://getbootstrap.com/2.3.2/javascript.html#modals 但是,这只允许将内容注入.modal-body ,而不是动态构建整个模态。 有没有办法用JS动态构建整个模态,包括.modal-header , .modal-footer ? 使用字符串执行此操作似乎非常笨重,如下所示: partial = render_to_string(:partial => ‘some-partial’).gsub(%{“}, %{‘}).gsub(/’/,”\\\\'”).gsub(“\n”, “”)

Highcharts不适合Bootstrap 3模态体

如何使用Bootstrap 3模态拟合并制作高图表图表? 看起来图表独立于页面的CSS,但我不确定。 ×Close Assortment Analysis Close $(function () { $(‘#container’).highcharts({ chart: { type: ‘column’ }, title: { text: ‘Stacked column chart’ }, xAxis: { categories: [‘Lazada’, ‘Competitor 1’, ‘Competitor 2’, ‘Competitor 3’, ‘Competitor 4’] }, yAxis: { min: 0, title: { text: ‘Price Range’ } }, tooltip: { pointFormat: ‘{series.name}: {point.y} ({point.percentage:.0f}%)’, shared: true […]

无法使用post响应更新Bootstrap的预先输入数据源

使用Bootstrap的typeahead javascript插件,我试图通过jQuery的$ .post方法更改数据源属性。 最初,我有: 然后,假设单击了一个按钮,它会尝试更新数据源: $(‘button’).on(‘click’,function(){ $.post(‘update.php’,function(resp){ $(‘input’).attr(‘data-source’,resp); }); }); resp XHR结果返回如下数组: [“One Option”,”Two Option”,”Three Option”] 我发现这不能使用响应中构造的新数组可靠地更新数据源。 有谁知道是什么问题? 这似乎不会捕获所选值。 有没有人知道如何使用带引导程序的typeahead获取所选值?

如何使用浏览器后退按钮关闭引导模式而不是返回页面?`

我发现这是智能手机的问题,它可能与桌面有关。 我们已经’修改’我们的引导模式以便响应,但是当在智能手机上显示它是全屏时,用户假设模态是页面并点击回“关闭”它。 我们已将右上角包含在X中,但也希望使用后退按钮来关闭模态。 有人有主意吗? 谢谢

在bootstrap-datetimepicker中设置默认时间

我想在此datetimepicker中将默认时间设置为当前日期的00:01。 以前有人试过吗? 度过难关。 看起来很简单。 $(‘#startdatetime-from’).datetimepicker({ language: ‘en’, format: ‘yyyy-MM-dd hh:mm’ }); 我需要使用setDate ,但我不确定如何。 我检查了他们的代码,但没有找到参数。

如何重用一个Bootstrap模态div?

我希望能够通过Bootstrap的模态插件在页面上使用多个不同的链接重用一个模态div: This button shows a modal (#utility) with text “Phasellus tincidunt gravida…” Modal 1 This button should invoke the same modal (#utility), but fill it with text “Phasellus egestas est eu…” Modal 2 × Click outside modal to close it One fine body…this is getting replaced with content that comes from passed-in href Close Save […]

在Bootstrap中动态添加/删除选项卡 – 激活创建的选项卡

以下是动态添加/删除引导选项卡的代码段。 一切正常,但我希望新创建的选项卡处于活动状态并且处于焦点,而不是用于动态添加选项卡的选项卡。 这是小提琴: http : //jsfiddle.net/isherwood/F33Av/4/ 这是有问题的代码: HTML: Joe Smithx Molly Lewisx + Add Contact Contact Form: Joe Smith Contact Form: Molly Lewis JS: $(“.nav-tabs”).on(“click”, “a”, function(e){ e.preventDefault(); $(this).tab(‘show’); }) .on(“click”, “span”, function () { var anchor = $(this).siblings(‘a’); $(anchor.attr(‘href’)).remove(); $(this).parent().remove(); $(“.nav-tabs li”).children(‘a’).first().click(); }); $(‘.add-contact’).click(function(e) { e.preventDefault(); var id = $(“.nav-tabs”).children().length; //think about it 😉 […]