Hello, I’m using a 3rd party WooCommerce AJAX Products Filter by Berocket and would like the off-canvas sidebar to close automatically after the filter results are calculated. Is there any solution?
This topic was modified 3 years, 1 month ago by hasan1986.
This topic was modified 3 years, 1 month ago by hasan1986.
This is likely happening due to the third party filtering plugin having AJAX activated. You could try disabling AJAX for the plugin, so that the page refreshes and closes the off canvas area automatically.
I know this method, and I had to use it, but I still hoped to find a method for ajax, but for this, as I understand it, I will have to turn to third-party programmers to implement this function.
If you can get the plugin to also make a JS action, after the filter has been applied, you can easily emulate a click using JS on the close button of the canvas area.
Here’s an example snippet.
let el = document.querySelector('.my-class')
if (el) {
el.click()
}
Hope this helps.
Thanks
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Auto close off-canvas sidebar’ is closed to new replies.