我对jQuery相当陌生,我正在尝试在我的页面上的2个不同元素上设置悬停意图。我让它在第一个上工作,但是当我将其添加到第二个时,它以某种方式抵消了第一个。让我知道我做错了什么,或者是否有更好的方法来格式化此代码。
提前谢谢你。
$(document).ready(function(){
$(".panel").hoverIntent(function() {
$(this).children('.info').slideDown();
}, function() {
$(this).children('.info').slideUp();
});
});
$(document).ready(function(){
$(".panel").hoverIntent(function() {
$(this).children('.info1').slideDown();
}, function() {
$(this).children('.info1').slideUp();
});
});
试试这个:
$(document).ready(function(){
$(".panel").hoverIntent(function() {
$(this).children('.info, .info1').slideDown();
}, function() {
$(this).children('.info, .info1').slideUp();
});
});