Created
October 28, 2012 11:15
-
-
Save takatoshi/3968356 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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