Tag: twitter bootstrap

ajax调用后,Bootstrap下拉列表不起作用(即使重新初始化后)

我通过stackoverflow扫描并了解它是否需要刷新ajax .load()的下拉列表…但是不确定这是如何工作的,因为单击下拉列表两次或三次它再次停止..:/ jQuery的 $(document).ready(function () { $(“#ios”).click(function(){ $(“#maincontent”).load(“ios.html”,function(){ $(“.dropdown-toggle”).dropdown(); }); }); }); HTML Smart Phones Android IOS Windows

Bootstrap Collapse force展开全部

我有一堆不同的部分,它们有自己的折叠元素。 我已经实现了jquery来扩展和折叠它们。 jQuery的: $(‘.collapse’).each(function (index) { $(this).collapse(“toggle”); }); HTML代码段: General Q. Can I choose my own Username and Password? A. Yes, you can choose your own Username and Password. We suggest using your email address for your Username, but any username that is between 8 and 20 characters long could be used. A secure Password […]

在输入点击和附加图标上触发jQuery datepicker元素

我有2个包含默认日期的输入字段,我正在使用jQuery的Datepicker插件从弹出式日历中选择日期。 当前,当用户单击字段时,将显示此日历。 这工作得很好,但是当用户也点击字段旁边的日历图标时,我还想触发日历的弹出窗口,所以我希望日历显示在两者上。 我正在使用Twitter Bootstrap 3。 以下是我目前的Jquery: $(“#FromDate”).datepicker({ dateFormat: ‘dd/mm/yy’, changeMonth: true, changeYear: true, }); $(“#ToDate”).datepicker({ dateFormat: ‘dd/mm/yy’, changeMonth: true, changeYear: true, }); 这就是我的页面看起来的样子

在移动设备中显示一个Bootstrap轮播项目

我有这个Bootstrap Carousel,它在Desktop视图中显示了2个项目。 但是,我想在Mobile视图中一次显示一个项目。 我怎样才能做到这一点? https://jsfiddle.net/v9t2pz9b/ HTML block1 block2 block3 block4 block5 block6 Previous Next JS: $(document).ready(function(){ $(“#myCarousel”).carousel(); }); 像设计中所示的东西。 我想在移动设备中一次只显示一张幻灯片:

Datapicker允许无效日期

当用户不知道确切的日期时,我需要允许日期,如’99 / 99/9999’,我该如何实现? $(‘#date’).datepicker({ language: “pt-BR”, autoclose: true, format: ‘dd/mm/yyyy’, todayHighlight: true }) 使用此代码,’99 / 99/9999’将转换为’07 / 06/9999’。 这是一个例子: https : //jsfiddle.net/bvbtz2re/2/

PopOver自动调整位置

我正面临PopOver的问题。 我想让它在所有位置自动调整。 如果它没有在右侧找到空间,则在左侧打开。 但我希望它能为顶部/底部做同样的事情。 即如果它没有在顶部找到空间,它应该在底部打开,反之亦然。 我有什么方法可以为所有方面做到这一点? $(‘[data-toggle=”popover”]’).popover({ trigger: ‘manual’, placement: ‘auto right’ }) HTML

重置bootstrap模式

所以,我正在使用bootstrap的模态。 我想制作一个向导式模态,并想出了以下解决方案: div片段: … … 在步骤a中按下按钮时,加载步骤b。 javascript片段: $(“#stepa”).replaceWith($(‘#stepb’)); document.getElementById(‘stepb’).style.display = ‘block’; 这很好用。 但是当我解雇模态时。 div step仍然被stepb取代。 我的解决方案是在隐藏模态时构建替换为stepa的替换: $(“#myModal”).on(“hidden”, function() { //replace the child }); 我试过了: $(‘#step1’).children().remove(); $(‘#step1’).append($(‘#stepa’)); 和 $(“#step1”).children(“div:first”).replaceWith($(‘#stepa’)); 但我很难选择步骤-a作为替换div,可能是因为它不是一个单独的div。 我的问题是,这是一个向导风格的模态的正确方法还是我应该采取另一种方法?

如何在没有系绳的情况下添加Bootstrap 4?

添加Bootstrap(v4.0.0-alpha.5)后,我收到以下错误。 bootstrap.js:2676 Uncaught Error: Bootstrap tooltips require Tether (http://tether.io/)(…) 我不想使用工具提示function,这需要tether.min.js用于bootstrap,因此我不想添加额外的tether.min.js。 无论如何使用bootstrap 4而不添加tether.min.js?

取消选择无线电选项

我正在使用引导单选按钮,并希望取消选择一个无线电组。 这可以使用额外的按钮(小提琴)来完成。 但是,如果在激活选项时单击该选项,我希望取消选择一个选定的无线电选项,而不是额外的按钮。 我试过这个 $(“.btn-group label”).on(“click”, function(e) { var clickedLabel = $(this); if ($(clickedLabel).hasClass(“active”)) { // an active option was clicked => deselect it $(clickedLabel).children(“input:radio”).prop(“checked”, false) $(clickedLabel).removeClass(“active”); } } ) 但似乎存在竞争条件:单击我使用的标签的事件似乎被bootstrap.js用于将单击的标签选项设置为“活动”。 如果我引入超时,则会成功删除“active”类: $(“.btn-group label”).on(“click”, function(e) { var clickedLabel = $(this); if ($(clickedLabel).hasClass(“active”)) { setTimeout(function() { // an active option was clicked => deselect it $(clickedLabel).children(“input:radio”).prop(“checked”, […]

inheritance/覆盖来自不同外部文件的现有CSS规则

我有一个现有的项目,曾经没有Bootstrap(3),但现在我必须改变它并保留旧的CSS。 我目前的CSS订单: var bundleCSS = new StyleBundle(“~/Views/bundle/newBundle”).Include( “~/Views/Shared/normalize.css”, “~/Scripts/jquery.ui/jquery-ui-latest.custom.css”, “~/Scripts/jquery.jqGrid/ui.jqgrid.css”, “~/Scripts/sweetalert/sweet-alert.css”, “~/Content/bootstrap.css”, “~/Views/Shared/OldButNeededLayout.css”, “~/Content/custom.css”); //will be rendered in that order custom.css用于修复将bootstrap.css添加到项目中的所有错误。 这里的问题是, OldButNeededLayout.css有OldButNeededLayout.css 3000行的css-code,顺便提一下当前的项目非常大。 因此,当用旧css覆盖引导程序而不是通过添加引导程序来修复错误时,我得到的结果不可预测。(因为我不知道它会改变什么) 怎么做或如何解决将bootstrap css / js集成到(我的)现有项目中的问题?