jQuery プラグイン修正版
前回のエントリーを修正しました。
というより前のがひどすぎました。
jQuery.fn.biyoon = function(scale,duration,easing){
//var target = this;
return this.each(function(){
ini_width=jQuery(this).attr("width");
ini_height=jQuery(this).attr("height");
jQuery(this).data({"ini_width":ini_width,"ini_height":ini_height});
jQuery(this).bind("mouseover",biyon).bind("mouseout",rbiyon);
//return target;
});
//拡大
function biyon(e){
selector=e.target;
after_width=selector.width*scale+"px";
after_height=selector.height*scale+"px";
$(selector).stop().animate({width:after_width,height:after_height},duration,easing);
}
//戻す
function rbiyon(e){
selector=$(e.target);
selector.stop().animate({width:selector.data("ini_width"),height:selector.data("ini_height")},duration,easing);
}
};