focusした場合に起動して、スピードも動きの幅も徐々に減っていく感じだと思うのですが、Javascriptはほぼ知識がないので、具体的なソースを教えてください。
(Jquery等を使う形でもOKです。)
urlが無いので想像で
http://jsfiddle.net/EKpJ6/
<!DOCTYPE HTML> <html lang="en"> <head> <meta charset="utf-8"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> <script> $(function() { $('#box').mouseover(function(){ $(this).animate({top:"10px"}, 200).animate({top:"0px"}, 200); }); }); </script> </head> <body> <div id="box" style="height:200px;width:200px;border:1px black solid;margin:50px;position:absolute;">hoge</div> </body> </html>
cssのtopなどを変更する場合はpositionをstatic以外にする必要があります。
参考:[JS]ホバー時、ふんわりとバウンドするモーションをつけるスクリプト | コリス
追記:
http://jsfiddle.net/EKpJ6/1/
<!DOCTYPE HTML> <html lang="en"> <head> <meta charset="utf-8"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> <script> $(function() { $('#box').hover(function(){ $(this).animate({top:"35px"}, 200).animate({top:"20px"}, 300); }, function(){ $(this).animate({top:"0px"}, 400); }); }); </script> </head> <body> <div id="box" style="height:200px;width:200px;border:1px black solid;margin:50px;position:absolute;">hoge</div> </body> </html>