在此站点的“特色项目”部分有一个动画效果。
我正在尝试为我的网站制作它,实际上我在大约一个月前开始这样做。但现在令人惊讶的是,它根本不起作用,只是让我有点模棱两可地弄清楚问题可能是什么。
我选择了错误的库,我的脚本是否有问题,或者它是一个错误?
HTML。
<a class="MainMiddleTwoEach MMTE1" href="#" title="This is the title 1">
<label class="MainMiddleTwoLabel1"></label>
<span class="MainMiddleTwoLabel2"></span>
</a>
JS。
$('.MainMiddleTwoEach').mouseenter(function (e) {
pageId = $(this).attr('href');
$(this).children('label').animate({ top: '150px' }, 300);
$(this).children('label').animate({ top: '-100px' }, 300);
$(this).children('span').animate({ top: '20px' }, 300);
$(this).children('span').animate({ top: '230px' }, 300);
}).mouseleave(function (e) {
$(this).children('label').animate({ top: '130px' }, 300);
$(this).children('label').animate({ top: '80px' }, 300);
$(this).children('span').animate({ top: '-10px' }, 300);
$(this).children('span').animate({ top: '55px' }, 300);
});