jQuery はじめてのjQueryプラグイン(駄作)
初めてのjQueryぷらぐいんです。しょぼー!
画像がびよーんってなります。
jquery.easing.jsが必要です。
2010.5.1 追記:
この内容、あまりにひどすぎたので修正版を次回エントリーに。
http://blog.macaroniworks.net/2010/05/jquery-プラグイン修正版/
jQuery.fn.biyoon = function(scale,duration,easing){
var target = this;
target.bind("mouseover",biyon).bind("mouseout",rbiyon);
ini_width=target.attr("width");
ini_height=target.attr("height");
return target;
function biyon(e){
selector=e.target;
after_width=selector.width*scale+"px";
after_height=selector.height*scale+"px";
target.animate({width:after_width,height:after_height},duration,easing);
}
function rbiyon(e){
target.animate({width:ini_width,height:ini_height},duration,easing);
}
};
関連記事