jeudi 28 août 2014

addEventListener fires only once


Vote count:

0




I'm trying to detect the orientation change for the responsive design. A specific function must be called when it occurs.


I try two different ways to do it :



window.addEventListener('resize', headerSlider , false);


Or



$(window).bind('resize', function() {

headerSlider();
});


Both work but only once. For exemple, if i'm in the portrait mode, i switch to landscape mode, the function is fired. But i think when to go back to the portrait mode again. The function is no longer called.


Please note i tried to use "orientationchange" instead of "resize" and the result is exactly the same


Thanks for your help



asked 19 secs ago







addEventListener fires only once

Aucun commentaire:

Enregistrer un commentaire