javascript - jquery check if element is visible in scroll div - How do I check if an element is hidden in jQuery?

jquery check if element is in viewport / javascript / jquery / dom / visibility

Is it possible to toggle the visibility of an element, using the functions .hide(), .show() or .toggle()?

Nicolas Gervais



Answer #1
var isVisible = $('#myDiv').is(':visible');
var isHidden = $('#myDiv').is(':hidden');
 $('#myDiv:visible').animate({left: '+=200px'}, 'slow');