我正在尝试使用mooTools Fx来缩放div的背景图像。我遵循了david welshs article中的自定义转换方法。我的mooTools/js技能只是基础水平,所以...
此外,我想知道是否有可能使用正弦过渡效果(虽然看起来不太可能)。
这是我尝试过的:http://jsfiddle.net/q2GQ7/ Javascript:
此外,我想知道是否有可能使用正弦过渡效果(虽然看起来不太可能)。
这是我尝试过的:http://jsfiddle.net/q2GQ7/ Javascript:
$$('#program a').each(function(item, index){
item.store('BackgroundZoomer', new Fx({ duration: 250}));
});
$$('#program a').each(function(item, index){
item.retrieve('BackgroundZoomer').set = function(value) {
var style = 200+value + "px " +200+value + "px";
this.setStyle('background-size', style);
};
});
$$('#program a').each(function(item, index){
addEvents({
'mouseenter': function(){
item.retrieve('BackgroundZoomer').start(0, 200); },
'mouseleave': function(){
item.retrieve('BackgroundZoomer').cancel();}
});
});