2010-11-05 54 views

回答

17

您可以检查元素.is():hidden,因为它会在向上滑动年底被隐藏,像这样:

$(this).slideToggle(function() { 
    if($(this).is(":hidden")) { 
    alert("this was a slide up"); 
    } 
}); 

You can test it out here

+0

谢谢尼克!像魅力一样工作。 – Alex 2010-11-05 15:09:07

+0

我错过了什么?你的例子报告了一种滑动方式。也许我不明白这个问题。 – Robusto 2010-11-05 15:14:21

+0

@Robusto - 那不是这种情况,你在哪个浏览器中? – 2010-11-05 15:19:59