私はcss jqueryメニューに取り組んでいます。このhttp://jsfiddle.net/A6rUG/のようなコードがあり、上ではなく下にアニメーション化しようとしています。コードは var slideNav = (function() {
var spanHeight,
nav = $('#nav'),
lis = $('li', nav),
anchors = $('a', lis).css('padding', 0);
$.each(anchors, function() {
var a = $(this),
val = a.text();
a.html('<span>' + val + '</span> <span>' + val + '</span>')
.parent('li')
.height(a.children('span:first').outerHeight())
.end()
.children('span:first')
.css('marginTop', 0) // strange for IE
});
spanHeight = lis.eq(0).height();
lis.hover(function() {
$(this).find('span:first').animate({
marginTop : -56
}, { duration: 200, queue : false });
}, function() {
$(this).find('span:first').animate({
marginTop : 0
}, { duration: 200, queue: false });
});
})();
marginTop または marginBottom を変更してもうまくいかないようです。誰かが何を知っていますか?