我猜这个问题很不言自明。这是我正在使用的代码:
function wkHover(){
$('.worksItem').hover(function() {
$('.worksItem').animate({ opacity: '0.5' }, 400, 'swing');
$(this).css({ opacity : '1' });
$(this).animate({ marginTop: '-10px' }, 400, 'swing');
}, function(){
$('.worksItem').animate({ opacity: '1' }, 400, 'swing');
$(this).animate({ marginTop: '0' }, 400, 'swing');
});
}
它可以做所有事情,除了将悬停的不透明度设置为 1。有什么想法吗?