在WordPress中升级到Bootstrap v4.0.0-beta后,Modal&Dropdown不起作用

国王

我的WordPress中有以下Modal&Dropdown,在以下方面运行良好v4.0.0-alpha.6

模态

 <a class="nav-link" data-toggle="modal" data-target="#navLinkSub" aria-
 haspopup="true" aria-expanded="false" href="#">
 Link</a>

 <div class="modal fade" id="navLinkSub" tabindex="-1" role="dialog" aria-
 labelledby="navLinkSub" aria-hidden="true">
 ....
 ...
 ...
 </div>

落下

<div class="dropdown">
            <button class="btn btn-light dropdown-toggle" type="button" id="navShare" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                share
            </button>
            <div class="dropdown-menu" aria-labelledby="navShare">
                <button class="dropdown-item" type="button">facebook</button>
                <button class="dropdown-item" type="button">twitter</button>
                <button class="dropdown-item" type="button">instagram</button>
            </div>
        </div>

与将bootstrap升级到相比,我没有更改任何可在Bootstrap的早期版本上正常工作的代码v4.0.0-beta

以下是jQuery&Bootstrap JS文件的顺序:

<script src="......../assets/js/jquery-3.2.1.min.js?ver=3.2.1"></script>
<script src="......../assets/bs/js/bootstrap.min.js?ver=20170722"></script>
ram02

和modal下拉代码看起来不错。尝试重新排列脚本。jQuery,Popper.js然后是bootstrap.js。另外,您必须在之后链接任何外部脚本。不要更改该顺序,这对于它的工作至关重要。

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>

可以使用的JSFiddle:https ://jsfiddle.net/pp9pdjtv/脚本位于屏幕左侧的外部资源选项卡中。

编辑:似乎您的脚本井井有条。一个或两个脚本较旧,并可能导致某种兼容性问题。因此,如果您的第一个修复程序不起作用,只需从src =“”标记中获取脚本,然后使用快捷键ctrl-s将它们保存到目录中。然后按照我之前所述的顺序链接它们,并确保您获得正确的脚本名称。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

将 neo4j 2.2 升级到 2.3 到 3.3 错误“无法将 v0.A.5 升级到 v0.A.8”

升级到 R v4 后如何使 gganimate 工作?

升级到v4后,自定义样式损坏

升级到15.10挂在libxfce4ui-1-0

从1.7.6-0升级到2.0.5-0后,Reviewboard未分配默认审阅者

为什么列表索引 [-4:0] 不起作用而 [0:4] 起作用?

升级到清漆v4

升级到Vue 3后,图像高度重置为0

升级到ubuntu 15.10后wlan0界面消失了

升级到Neo4j v2.1.2后,Cypher查询不起作用

args ._ [0]中的._ [0]有什么作用?

Auth0 升级到 Node8

setInterval 0在IE8中不起作用

xs={false} 或 xs={0} 在 MUI React 中不起作用

css margin:0 auto在Firefox中不起作用

当scanf在c中返回0只是不起作用

Google Sheets API V4 - 自动填充错误 - 没有 id: 0 的网格

升级到iOS13 beta 6 / Xcode 11 beta 5后:发出“ dyld:未找到符号:_ $ s7SwiftUI7BindingVyxGAA0C11ConvertibleAAMc”

0,因为饱和度和亮度不起作用,但在hsl / hsla中却为0%?

位掩码(char)(0xFFFFFFB8&0xFF)在c中不起作用

COALESCE(SUM(...),0)COALESCE(COUNT(...),0)在我的代码中不起作用

XML反序列化不起作用-XML文档中存在错误(0,0)

SonarQube + Maven + JaCoCo + GitLab CI:Sonar升级到SonarQube 7.9.2后开始显示0%的代码覆盖率

无法创建系统映像。从8升级到8.1后出现0x80780119错误

从 Ubuntu 16.04 升级到 20.04 后重新连接 raid 10 驱动器 md0

升级到Rails 3.1后,没有路由与[GET]“ / reporting / from_perl / 0”相匹配

在将我的应用程序从Rails 3.2.13升级到4.2后,link_to停止工作(错误的参数数量(0表示0表示2)

应用 top:0 后,CSS 粘性位置不起作用;

从mysql中选择后“== 0”不起作用