[javascript] Detect if an element is visible with jQuery