LoginSignup
1
0

More than 1 year has passed since last update.

Bootstrap5のメニューが閉じない

Posted at

Bootstrap5のNavbarのハンバーガーメニューがなぜか閉じなくて、解決までに時間がかかったのでメモします。

以前のbootstrap4では、Navbarデフォルトのままだと、メニューが閉じないということがあったみたいですが、今回使用しているのはBootstrap5なのに。。。なぜ。。。

結論

bootstrap.bundle(.min).jsとbootstrap(.min).jsを同時に呼び出していたためでした。
どうやら、bootstrap.bundle(.min).jsはbootstrap(.min).jsを内包しているようです。
なので、二つ同時に呼び出すとbootstrap(.min).jsが二回呼ばれてコードが競合してしまっていたため不具合が起きたのかなと思います。

※minは圧縮ファイルのことです。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0