I am currently developing a photo gallery and I am trying to add some CSS styling to the first photo that is visible within my #wrapper div. Below is the code snippet I have been working on:
$('.inside:first-of-type>div:nth-of-type(1)').css('display', 'none');
$('.inside:first-of-type>div:nth-of-type(2)').css('display', 'block');
All elements that are within view of the #wrapper div are given the class .inside, which is removed once they slide outside the #wrapper. Each photo consists of two div layers. In this particular case, I want to hide the first layer and display the second one. The current code seems to work when the first photo in the sequence is visible, but does nothing if it's not.
Do you think there might be an issue with my CSS code?