【发布时间】:2012-09-26 12:51:27
【问题描述】:
在 jQuery 中,假设您使用.hide()、.show() 或.toggle() 隐藏和显示某种元素。您如何测试该元素当前在屏幕上是隐藏还是可见?
【问题讨论】:
标签: jquery visibility
在 jQuery 中,假设您使用.hide()、.show() 或.toggle() 隐藏和显示某种元素。您如何测试该元素当前在屏幕上是隐藏还是可见?
【问题讨论】:
标签: jquery visibility
$('.target').is(':hidden') // returns true if the element is hidden
$('.target').is(':visible') // returns true if the element is visible
【讨论】: