所以我正在使用以下Mootools Class来制作我的标题菜单,主要是使用变形效果。
要查看Google Chrome或Firefox http://proclef.geantduweb.ca/
中的以下链接我有另一个网站遇到同样的问题。动画有点不同,但它基于相同的代码。
在Internet Explorer中:我没有获得任何控制台错误,其余的javascript运行正常。
有什么想法吗?我是stump ...我试过一个Tween ...但变形到类似乎是最好的选择
由于
var gdwMainmenu = new Class({
options: {
author: 'Géant du web - MB',
updatedby: 'Géant du web - Jonathan Robidas',
version: '1.3',
lastUpdate: '2014-10-03'
},
Implements: [Options,Events],
initialize: function(options) {
this.setOptions(options);
if ($('header')) {
this.mainmenu = $('header');
this.placeholder = $('mainmenuplaceholder');
this.effect_header = new Fx.Morph('header', {
duration: 500,
transition: Fx.Transitions.Sine.easeOut
});
this.effect_logo = new Fx.Morph('logoimg', {
duration: 1000,
transition: Fx.Transitions.Sine.easeOut
});
this.effect_table1 = new Fx.Morph('table1', {
duration: 500,
transition: Fx.Transitions.Sine.easeOut
});
this.effect_table2 = new Fx.Morph('table2', {
duration: 500,
transition: Fx.Transitions.Sine.easeOut
});
this.scrollFix();
window.addEvent('scroll', this.scrollFix.bind(this));
}
},
scrollFix: function() {
var sp = window.getScroll().y-20;
var wp = $('header').getSize().y-40;
if (sp > wp) {
this.setToFixed();
} else {
this.setToNotFixed();
}
}, //End of scrollFix()
setToFixed : function() {
if (!this.mainmenu.hasClass('active-fixed')) {
this.mainmenu.addClass('active-fixed');
this.placeholder.addClass('active-fixed');
//Image then container
this.effect_logo.pause();
this.effect_logo.start('#header.isFixedImg').chain(function() {
this.effect_header.pause();
this.effect_header.start('#header.isFixed');
this.effect_table1.pause();
this.effect_table1.start('#header.noWidth1');
this.effect_table2.pause();
this.effect_table2.start('#header.fullWidth2');
}.bind(this));
}
}, //End of setToFixed()
setToNotFixed : function() {
if (this.mainmenu.hasClass('active-fixed')) {
this.mainmenu.removeClass('active-fixed');
this.placeholder.removeClass('active-fixed');
//Container first then image
this.effect_header.pause();
this.effect_header.start('#header.notFixed').chain(function() {
this.effect_logo.pause();
this.effect_logo.start('#header.notFixedImg');
this.effect_table1.pause();
this.effect_table1.start('#header.fullWidth1');
this.effect_table2.pause();
this.effect_table2.start('#header.noWidth2');
}.bind(this));
}
} //End of setToNotFixed()
});
window.addEvent('load', function() {
if ($('header')) {
var menuFixed = new gdwMainmenu();
}
});