0

I have a custom slider, that is only shown when the user clicks on a certain font awesome button.This model works quite well for me. I add an event listener to the slider object for the focusout event, and then just show or hide the slider.

I do notice however that when the user resizes the browser screen, this is not seen as a focusout, because in this case my slider does not disappear ( I would like it to).

So my question is, what event will capture the resizing of the browser window, in order for me to hide my slider this way?

Thanks!

Harriet
  • 1,303
  • 5
  • 19
  • 31
  • [`window.onresize`](https://stackoverflow.com/questions/641857/javascript-window-resize-event) ?? – Turnip Jul 25 '17 at 14:33
  • Thanks for you reply. I just got it working using: window.addEventListener("resize", OnSliderLoosingFocus); Where OnSliderLoosingFocus is my method name that needs to be executed. – Harriet Jul 25 '17 at 14:42
  • Google would have found you your answer quicker than posting this question. – Turnip Jul 25 '17 at 14:46
  • Possible duplicate of [JavaScript window resize event](https://stackoverflow.com/questions/641857/javascript-window-resize-event) – Turnip Jul 25 '17 at 14:46
  • I was caught up looking at events to register on the slider elements itself, rather than on the window. Sometimes the answer to a question is obvious but there is a lesson to be learnt anyway. – Harriet Jul 25 '17 at 14:52

0 Answers0