Effet slide qui ne fonctionne pas sous chrome
hello a tous
voila j'ai un script de silde qui fonctionne avec mootools 1.11
sur mon site
http://www.lebbb.org/1-Programmation.html
(si on descend le menu descend)
le soucis c'est que sur chrome et safari niet ....
il fait une erreur
Code:
mootools.v1.11.js:4457Uncaught TypeError: Cannot call method 'getStyles' of null
a cette ligne
Code:
this.wrapper = new Element('div', {'Styles': $extend(this.element.getStyles('margin'), {'overflow': 'hidden'})}).injectAfter(this.element).adopt(this.element);
le code complet
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| Fx.Slide = Fx.Base.extend({
options: {
mode: 'vertical'
},
initialize: function(el, options){
this.element = $(el);
this.wrapper = new Element('div', {'Styles': $extend(this.element.getStyles('margin'), {'overflow': 'hidden'})}).injectAfter(this.element).adopt(this.element);
this.element.setStyle('margin', 0);
this.setOptions(options);
this.now = [];
this.parent(this.options);
this.open = true;
this.addEvent('onComplete', function(){
this.open = (this.now[0] === 0);
});
if (window.webkit419) this.addEvent('onComplete', function(){
if (this.open) this.element.remove().inject(this.wrapper);
});
},
setNow: function(){
for (var i = 0; i < 2; i++) this.now[i] = this.compute(this.from[i], this.to[i]);
},
vertical: function(){
this.margin = 'margin-top';
this.layout = 'height';
this.offset = this.element.offsetHeight;
},
horizontal: function(){
this.margin = 'margin-left';
this.layout = 'width';
this.offset = this.element.offsetWidth;
}, |
n'étant pas a m'origine du code javascript je galere un peu pour trouver une solution
Merci par avance pour votre aide