EDIT : THe problem is that the site is sooo bad, and he is still in document.readyState = "interactive" so I don't have resize events :'(
I'm working on a website (that I didn't made). I'm trying to integrate a banner properly. I face a problem with IE 10/9. The even resize is not working.
this is the code i use
function addEvent(elementDOM, evenement, fonction){
var refEvent = null;
if(elementDOM)
{
if (elementDOM.addEventListener)
{
refEvent = fonction;
elementDOM.addEventListener (evenement,refEvent,false);
}
else if (elementDOM.attachEvent)
{
refEvent =function() {
return fonction.call(elementDOM,window.event);
};
elementDOM.attachEvent ('on'+evenement,refEvent);
}
else
{
elementDOM["on"+evenement] = fonction;
}
}
return refEvent;
}
I call it like that :
addEvent(window,"resize",function(){
console.log("a");
});
And this doesn't works on IE 10 and 9 (it works on FF and Chrome) I enter in the AddEventListener if, but no events are fired. I never see my console log ("a")
the website is this one
http://www.courrierinternational.com/
Can someone help me cause I'm stuck... I really don't know what could be the problem.
Thx :3