Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omermindivanli/b4deb59d001d5155e2221a943a0ef8d1 to your computer and use it in GitHub Desktop.
Save omermindivanli/b4deb59d001d5155e2221a943a0ef8d1 to your computer and use it in GitHub Desktop.
In Client-Side Rendering React, When you click to Bootstrap Navbar, it does not collapse. Here is the solutiıon
<script>
//In Client-Side Redering React, Bootstrap
//Navbar not collapsing problem
$(function () {
var navMain = $('.navbar-collapse');
navMain.on('click', 'a', null, function () {
navMain.collapse('hide');
$("html, body").scrollTop({ scrollTop: 0 }, "slow");
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment