Tag: twitter bootstrap

$(…)。.popover不是一个函数

我在这里看了很多关于这个问题的post,但是它们似乎都没有解决我的问题。 我已按正确的顺序导入了jQuery和Bootstrap js文件。 像引导板这样的东西对我来说非常好。 我的脚本导入是这样的: 但是,当我尝试 $(‘[data-toggle=”popover”]’).popover(); 我在Chrome控制台中收到以下消息: Uncaught TypeError: $(…).popover is not a function 起初我想也许popover没有包含在CDN的副本中,所以我继续下载了一个本地副本,其中包含了所有插件: http://getbootstrap.com/customize/ 并得到相同的错误消息(重新指向脚本标签朝向本地js文件)。 搜索“popover”bootstrap.min.js文件: http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js 显示popover包含在文件中。

‘show’事件不会在IE9中使用Rails中的Twitter Bootstrap Modal触发

我有一个涉及几个不同框架/库的问题,尽管主要是Twitter Bootstrap(js)和Rails。 我的应用程序中有一个链接,它响应了一些js: $(function() { var $modal = $(‘ @product, :customer => @customer, :booking => @booking ) %>’), $calendar = $modal.find(‘#calendar’), currentProduct = ;, initBookingCalendar; $(‘body’).append($modal); $modal.modal(‘show’); /* Booking Calendar */ initBookingCalendar = function(el, productId) { el.fullCalendar() … }; $($modal).on(‘shown’, function() { if($calendar.is(‘:empty’)) { initBookingCalendar($calendar, ); } }); }); 问题是由于某些原因,IE9中没有触发“显示”事件! 我在这里重现了这个问题: http : //jsfiddle.net/tvkS6/并通过这样做得到它: http […]

Bootstrap按钮加载+ Ajax

我正在使用Twitter Bootstrap的按钮加载状态( http://twitter.github.com/bootstrap/javascript.html#buttons )。 HTML: JS: (function ($, undefined) { $(“#accountRegister”).click(function () { $(this).button(‘loading’); $.ajax({ type:”POST”, url:”/?/register/”, data:$(“#loginForm”).serialize(), error:function (xhr, ajaxOptions, thrownError) { $(“#accountRegister”).button(‘reset’); }, success:function (data) { $(“#accountRegister”).button(‘reset’); } }); return false; }) })(jQuery); 但如果我有很多按钮,我需要编写许多function(?)。 当然我可以做这样的事情: $(“.ajax-button”).bind(“click”, function() { $(this).button(“loading”);}) 我可以使用jQuery Ajax事件ajaxComplete $(“.ajax-button”).bind(“ajaxComplete”, function() { $(this).button(“reset”);}) 但是这样,当任何 Ajax请求完成时, 所有按钮都将设置为正常状态。 如果用户单击button1然后单击button2 (两个按钮都发送Ajax请求),则在第一个Ajax请求完成时,它们将被设置为正常状态。 如何确定我需要将哪个按钮设置为正常状态? 先感谢您。 UPDATE […]

Twitter Bootstrap 2:Navbar子菜单链接不起作用

更新到Twitter Bootstrap 2.0(很棒)后,子菜单中的导航链接不起作用。 jQuery是1.7.1。 Dropdown实际上是有效的,并且标记是正确的(根据文档): ‘brand’)); ?> <?php echo anchor('#', 'Inscripciones ‘, array(‘class’ => ‘dropdown-toggle’, ‘data-toggle’ => ‘dropdown’)); ?> 注意:我使用Codeigniter生成链接,但使用普通标签也不起作用。 插件正确加载。 我用jQuery(‘.dropdown-toggle’).dropdown();调用下拉列表jQuery(‘.dropdown-toggle’).dropdown(); 我不知道还能做什么或检查。 任何提示?

Twitter Bootstrap – 如何在工具提示弹出窗口和元素之间添加更多边距

我没有尝试任何东西,因为我无法理解工具提示和元素之间的空间是从bootstrap创建/添加的,通常工具提示实际上是触发工具提示事件的元素附近。 我只想让工具提示开始离元素稍微偏离,从工具提示和eleemnt中添加更多的余量。 如果可能的话,我想了解如何在css中执行此操作,如果可以将其设置为右侧,左侧,顶部,底部工具提示 希望问题很清楚。 这就是工具提示在我的应用上的外观: 这就是我想做的事情以及他们应该如何照顾

$(’。col-md-9’)。width()返回0

我已经使用Bootstrap实现了导航标签。 当一个特定的选项卡变为活动状态时,我试图获取div的宽度。 当正确检测到活动选项卡时,宽度返回0.我不确定为什么会发生这种情况。 这是一个小提琴: http : //jsfiddle.net/pThn6/811/ HTML: AAA BBB CCC …Content vol… …Content… JS: $(function() { $(‘a[data-toggle=”tab”]’).on(‘click’, function(e) { var s = “” + (e.target); if(s.search(‘aaa’) != -1) { alert($(‘.col-md-9’).css(“width”)); } }); }) 我怎么解决这个问题?

如何使用twitter bootstrap从ajax加载文本框中的数据?

我尝试使用bootstrap typeahead函数在文本框中加载简单的ajax返回值。 如果我通过警告检查它会返回数据但是当我输入文本框时什么也没有。 我尝试使用直接数据source:[‘albama’,’utah’]没有ajax它工作正常。 我已经包含了所有相关文件。 一世 $(document).ready(function() { $(‘#subjects’).typeahead ({ source: $.ajax({ url: “./test/test.php”, type: “POST”, data: “search=” + $(‘#subjects’).attr(‘value’), success: function(data) { var subjects = [‘Albamsa’, ‘Washington’, ‘New York’, ‘Arlington’, ‘New Jersey’]; return subjects; } }) }); });

Bootstrap输入组分段移动元素

我有这个HTML代码(使用Bootstrap 3 ): Part title 3 4 而这个jQuery代码: $(‘.linkInterfaces’).click(function () { if ($(this).find(‘i’).hasClass(‘fa-link’)) { $(this).animate({‘marginLeft’: ’10px’, ‘marginRight’: ’10px’}, 1000); $(this).find(‘i’).removeClass().addClass(‘fa fa-chain-broken’); } else { $(this).animate({‘marginLeft’: ‘0’, ‘marginRight’: ‘0’}, 1000); $(this).find(‘i’).removeClass().addClass(‘fa fa-link’); } }); 我已经为你做了这个JSFIDDLE ,以便更好地理解我的问题。 如何确保中间按钮永远不会移动,如果你点击它,那些周围移动的人?

无法绑定带有文本字段的JQuery Generated行的twitter bootstrap typeahead

我有一个单行的表,行的第一个单元格中有一个文本字段,而文本字段绑定到一个单独的js文件中的twitter bootstrap typeahead。 但是用户可以使用“添加”按钮创建行,并克隆第一行以创建其他行。 现在我希望typeahead在这些克隆的文本字段中工作正常,但它没有,并且控制台中没有显示错误。 克隆的文本字段与原始文本字段具有相同的ID和名称。 知道为什么会这样吗? 以及如何处理它的任何建议?

从代码后面的bootstrap popover

在我的gridview标题中,我有用户名,我需要的是在用户点击用户名时在bootstrap popover中显示用户详细信息。 我尝试下面只是为了检查是否可以从后面的代码显示popover但它不起作用: ASPX: the popover link some title × 代码背后: Protected Sub I1_Click(sender As Object, e As System.EventArgs) Handles I1.Click Dim sb As New System.Text.StringBuilder sb.Append(“”) sb.Append(“$(‘#popover’).popover({“) sb.Append(“html: true,”) sb.Append(“title: function () {“) sb.Append(“return $(“”#popover-head””).html();”) sb.Append(“},”) sb.Append(“content: function () {“) sb.Append(“return $(“”#popover-content””).html();”) sb.Append(“}});”) sb.Append(“”) ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), “popoverscript”, sb.ToString(), False) End Sub 如何从后面的代码或任何替代方案中调用popover? 请帮忙… 谢谢,纳文