Resizing window requires refresh to trigger interactions written in jquery

Hello, Community

I’m facing an issue of custiom jquery not triggering on window resize like i have written custom jquery to open submenu on hover but when i resize the window the submenu do not appear on hover. And then i have to refresh to get the submenu open on hover.

I have tried window.load and window.resize but its not working

Could you share your code snippet?

You might want to add an event listener for your window resize as such:

window.addEventListener('resize', function(event) {
    //your code here
}, true);