mooTools Fx を使用して、div の背景画像をズームしようとしています。カスタム変換を行うには、デビッド・ウェルシュの記事に従いました。私の mooTools/js スキルはごく基本的なものです。
また、たとえばサイントランジションを使用するために組み込む可能性があるかどうか疑問に思っています(それは似ていませんが)。
これが私が試したことです: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();}
});
});