Currently facing an issue where a menu should open/close on mobile devices. To achieve this, I have implemented an if-statement to check the browser width and execute a script accordingly:
$(window).resize(function() {
var mobilewidth = $(window).width();
if(mobilewidth < 873 ) {
$(".mod_customcatalogfilter h2").click(function() {
$(".filterform").slideToggle();
});
} else {
$(".filterform").removeAttr("style");
}
});
Although it is functional, the .filterform
seems to be bouncing up and down before closing.
To see the issue in action, please visit: http://codepen.io/Sukrams/pen/WwjejP
If anyone has any insights as to why this behavior occurs, your input would be greatly appreciated.