Fixed javascript effect for hidden elements