Check out this code snippet I put together in Codepen:
<div class="slider">
<ul>
<li id="S1">
<div class="txt"><p>First slogan</p></div>
<div class="img"><img src="http://placehold.it/800x180" /></div>
</li>
<li id="S2">
<div class="txt"><p>First slogan</p></div>
<div class="img"><img src="http://placehold.it/800x280" /></div>
</li>
</ul>
<a href="#S1">1</a>
<a href="#S2">2</a>
</div>
I want to achieve the following functionality with JQuery:
Initially, only the first LI item should be visible.
When an A tag is clicked and its href value does not match the ID of the visible LI:
- Fade out the current LI;
- Resize the Slider container DIV Height to the height of the LI to be displayed;
- Fade in the LI to be displayed.
Can someone help me implement this with JQuery?
Thanks, Miguel