少し問題があり、それを解決しようとするのにうんざりしています。jQuery イージング コードは jsfiddle では完全に機能しますが、localhost のテスト サーバーでは機能しなくなりました。jQuery イージング効果を削除すると、正常に戻り、コードは正常に動作します...
コードに何か問題があるのだろうか?それはOnLoad機能の関係か何かでしょうか...!!
<head>
<script src="http://gsgd.co.uk/sandbox/jquery/easing/jquery.easing.1.3.js" type="text/javascript" ></script>
<script src="http://code.jquery.com/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
jQuery(function($) {
$('.topnav li').find('a[href]').parent().each(function() {
var li = $(this),
a = li.find('a'),
div = $('<div>' + '<\/div>');
li.hover(function() {
a.stop().animate({marginTop: '-64'}, 600, "easeOutBack");
},
function() {
a.stop().animate({marginTop: '0'}, 500, "easeOutBack");
})
.append(div);
});
});
JSFiddle コードは次のとおりです。