Skip to content

Instantly share code, notes, and snippets.

@zHaytam
Created April 22, 2018 16:37
Show Gist options
  • Save zHaytam/64a49ddf6d2073fbb7b1999fb31e4b6e to your computer and use it in GitHub Desktop.
Save zHaytam/64a49ddf6d2073fbb7b1999fb31e4b6e to your computer and use it in GitHub Desktop.
Bootstrap 4 dropdown-on-hover test
// Bootstrap 4 dropdowns on hover
$('body').on('mouseenter', '.dropdown-on-hover', function (e) {
_d = $(e.target).closest('.dropdown>a');
_d.dropdown('toggle');
});
$('body').on('mouseleave', '.dropdown-on-hover', function (e) {
var _d = $(e.target).prev('a');
console.log(_d);
_d.dropdown('toggle');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment