Is this the correct jQuery syntax for checking if the div is hidden && has a class of “view”? If it does, then reveal the next hidden div with class “view” after .3 second?
Note it’s not currently working though, it fades in ALL hidden divs regardless of the class.
<script type="text/javascript">
$(function() {
// Start showing the divs
showDiv();
});
function showDiv() {
// If there are hidden divs left
if($('div:hidden').length.hasClass('view')) {
// Fade the first of them in
$('div:hidden:first').fadeIn();
// And wait one second before fading in the next one
setTimeout(showDiv, 300);
}
}
</script>
Probably a better solution is