The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Inconsistent behavior of the event handler added by the onResize function

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
  • #262172

    Hello, in my CSS DropDown menu I have defined via an if-block that if it is a touch-device or falls below a certain window size (width 900px), the menu Click-Event-Handler is toggled by CSS- Classes are added.

    The current window size is determined by querying the CSS property: ‘Display: flex’, which is set by the media queries at a width <900px.

    This works well on onLoad.
    But once this is triggered through the Resize feature, the click events (width <900 px) will be unreliable.

    This is probably due to the fact that onResize fires the document with the toggling click event handlers contained in the executed functions.

    Can someone tell me how to remove them from the Resize function without destroying functionality?


Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.