Bonjour !
getBoundingClientRect ne marche pas sur IE 11 , mais par contre avec Firefox sa marche très bien.
comment y remédier à ce problème.
Version imprimable
Bonjour !
getBoundingClientRect ne marche pas sur IE 11 , mais par contre avec Firefox sa marche très bien.
comment y remédier à ce problème.
C'est une function prototype qui test la compatibilité et implémente une alternative pour IE11 par contre pas testé j'ai pas IE :(.
glCode:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 HTMLElement.prototype.getBoundingClientRect = (function () { var oldGetBoundingClientRect = HTMLElement.prototype.getBoundingClientRect; return function() { try { return oldGetBoundingClientRect.apply(this, arguments); } catch (e) { return { left: '', right: '', top: '', bottom: '' }; } }; })();
C'est pourtant une méthode spécifique IE à la base... Il n'y a aucune raison pour qu'elle ne fonctionne pas sur IE11...
Oui j'ai vu mon problème j'appelais mal cette méthode merci.