我是jQuery的新手,我正尝试在我的页面上的两个不同元素上设置一个hoverIntent。我让它在第一个上工作,但是当我把它加到第二个上时,它以某种方式抵消了第一个。让我知道我做错了什么,或者有没有更好的方法格式化这段代码。
提前谢谢你。
$(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();
});});
发布于 2012-10-17 08:56:04
试着这样做:
$(document).ready(function(){
$(".panel").hoverIntent(function() {
$(this).children('.info, .info1').slideDown();
}, function() {
$(this).children('.info, .info1').slideUp();
});
});https://stackoverflow.com/questions/12925604
复制相似问题