I am using a simple jquery plugin to achieve a dropdown on hover effect in Bootstrap 3. It works perfectly on desktop as well as mobile (reverts to original bootstrap dropdown behavior) but when the user resizes the browser window on a desktop the hover still functions. I am trying to disable it all together after the collapse of my navbar which is at 768px.
I am using the following plugin: https://github.com/CWSpear/bootstrap-hover-dropdown
I ended up using the following solution:
$(function () {
if ($(window).width() > 768) {
$('.dropdown-toggle').dropdownHover();
}
});
But I can't get it to work perfectly, right now if you refresh the page at 768px or lower the plugin doesn't fire (dropdown works on mouse click) but if you scale down from anything bigger it continues to fire. I am just a little bit out of my league if anyone can help out.