このメニューでは、ホバーされた div が展開され、他のすべての要素が縮小されます
サイズを変更すると、メニューの右側に小さな揺れがあり、本当に迷惑です
私はこれを見ました:中央から展開するCSSを使用して、上と左だけでなく中央からdivを 展開し、ウィグルについても言及しています
ぐらつきを直す方法はありますか?
これは私のコードです
ご覧のとおり、速度は常に同じであるため、理論的には揺れはありません。
function add() {
var speed = 50;
$('.space').hover(
function() {
var n = this.id.replace(/[^\d]/g, '');
$('#space_' + n).removeClass('contract');
$('#space_' + n).stop().animate({
height: "107px",
width: "107px",
}, speed, 'linear');
$('.contract').stop().animate({
height: "73px",
width: "70px",
}, speed, 'linear');
},
function() {
var n = this.id.replace(/[^\d]/g, '');
$('#space_' + n).addClass('contract');
if($('#space_' + n).hasClass('selected') != true) {
$('#space_' + n).stop().animate({
height: "73px",
width: "73px",
}, speed, 'linear');
}
$('.contract').stop().animate({
height: "73px",
width: "73px",
}, speed, 'linear');
}
);
}
add();
ここでメニューの例を見ることができます: http://mellroy.com/dean/
前もって感謝します