Tag: twitter bootstrap 4

如何延迟删除下拉菜单Bootstrap 4的类?

我试图在导航栏上切换一个类切换,但是当您移动鼠标时,下拉菜单会快速删除该类并隐藏菜单。 我认为它需要的只是延迟上课,但课程的表现仍然是即时的。 以下是hover问题http://sofzh.miximages.com/jquery/o8ccCn9.gifv的屏幕截图 是否有手动方式来编写切换? Codepen: https ://codepen.io/JacobLett/pen/jaaQYG ?编辑= 0110 到目前为止这是脚本 $(document).ready(function() { // executes when HTML-Document is loaded and DOM is ready // when you hover a toggle show its dropdown menu $(“.navbar .dropdown-toggle”).hover(function () { $(this).parent().toggleClass(“show”); $(this).parent().find(“.dropdown-menu”).toggleClass(“show”); }); // hide the menu when the mouse leaves the dropdown $( “.navbar .dropdown-menu” ).mouseleave(function() { $(this).removeClass(“show”); […]

如何创建一个复制并插入自己的div的函数?

编辑 :访问https://jsfiddle.net/DTcHh/40740/获取最终解决方案! 更新 :这个问题是一个后续问题 ! 我有一个带有“添加问题”(Bootstrap)单选按钮的div。 我的意图是,当点击上面提到的按钮时,应该复制放置按钮的div并将其放在下面: 我怎么做? 单击按钮时没有任何反应。 js.fiddle HTML: Question: Enter avaible options: Add Question Save Test jQuery的 $(“#radioAddQuestion”).click(function() { var html = $(“#” + singleQuestionModule).html(); $(html).insertAfter(“#” + singleQuestionModule); }); 这是我试图重现的一个工作示例 (不是我的代码)。

为什么在注入Bootstrap 4 Modal时没有加载javascript代码?

我有一个javascript函数,它打开一个Bootstrapmodal dialog: function showModal(message, headerMessage, sticky, noFooter){ var modal = $(”,{ class: ‘modal fade hide’, role: “dialog”, ‘aria-labelledby’: “modalTitle”, ‘aria-hidden’: “true”, tabindex: -1 }); var modalDialog = $(”,{ class: ‘modal-dialog’, role: “document” }); modal.append(modalDialog); var modalContent = $(”,{ class: ‘modal-content’ }); modalDialog.append(modalContent); var header = $(”,{ class: ‘modal-header’ }); if(headerMessage == undefined) headerMessage = ” “; […]

使用jQuery在Bootstrap 4中过滤卡片

我正在尝试使用bootstrap 4的新卡组件创建一个由许多卡填充的页面。 我想创建一个搜索栏,搜索时会筛选出标题与搜索查询不匹配的卡片。 这是我想到的东西。 Plunker 我希望这些卡片能够display: none一个display: none ,或opacity:0如果它们不匹配。 我目前正在尝试编写一个函数,搜索栏的onChange执行此操作。 我会发布,如果我能弄明白的话。 我也试过使用内置代码段function。 Card title that wraps to a new line This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a […]

Bootstrap 4导航栏下拉菜单项无法在移动设备上单击

我有一个使用Bootstrap 4开发的网站。当从移动设备查看并且菜单项已折叠到3个条形时,菜单项不可点击。 我试过像bootstrap docs建议的那样实现它,但它仍然没有用。 我尝试过其他一些调整无济于事。 我在这里做错了什么(除了使用alpha版本)? 这是您可以测试它的网站: http : //www.wrestlestat.com 请记住,如果您只是将浏览器从桌面调整到移动设备大小,一切正常,只有在从移动设备查看时才能正常工作。 这是导航菜单的代码: ☰ Donate Donate Teams Fantasy Pick’Em Tourney Pool Compare Dual Lineup Wrestlers Rankings Wrestlers 125 133 141 149 157 165 174 184 197 285 Dual Team Tournament Team Statistical Profile Login Register Forgot Password 这是一个bootply,但可能没有多大好处,因为它必须在移动设备上才能工作。 http://www.bootply.com/9Z9oycwCSh