Skip to content

Instantly share code, notes, and snippets.

@takatoshi
Created October 28, 2012 11:15
Show Gist options
  • Save takatoshi/3968356 to your computer and use it in GitHub Desktop.
Save takatoshi/3968356 to your computer and use it in GitHub Desktop.
$(function(){
//関数として定義
$.fn.hoverAnimation = function() {
//付加するクラス名
var className = "hover";
$(this).mouseover(function(){
//第一引数:付加するクラス名、第二引数:スピード(ミリ秒)
$(this).not(":animated").addClass(className, 200);
}).mouseout(function(){
$(this).removeClass(className, 180);
});
};
//変化させたい要素を指定して実行
$("div.jquery_ui_example").hoverAnimation();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment