我正在尝试在某些代码(http://www.minimamente.com/magic-css3-animations/)中使用一些魔术 css 类,并尝试使用带有 mouseenter 和 mouseleave 的 jquery 添加它们,但是它不工作......在全部!
以下是我尝试过的代码
$(document).ready(function(){
$('#banner-holder').on('mouseenter', function(){
$(this).find('#prev, #next').addClass('magictime perspectiveLeft');
});
$('#banner-holder').on('mouseleave', function(){
$(this).find('#prev, #next').removeClass('perspectiveLeft');
$(this).find('#prev, #next').addClass('perspectiveLeftRetourn');
});
});
它触发perspectiveLeft,但在鼠标移出时它不会执行perspectiveLeftRetourn。我犯了一个简单的错误吗?