I've completed this code so far:
<div class="yearly-archive">
<p> YEAR - <span class="archive-year year-active"> 2014 </span> /
<span class="archive-year"> 2013 </span> /
<span class="archive-year"> 2012 </span> /
<span class="archive-year"> 2011 </span> /
<span class="archive-year"> 2010 </span>
</p>
</div>
<div class="news-container news-active" id="news-2014"></div>
<div class="news-container" id="news-2013"></div>
<div class="news-container" id="news-2012"></div>
<div class="news-container" id="news-2011"></div>
<script>
$('.archive-year').click(function() {
$('.archive-year').removeClass('year-active');
$(this).addClass('year-active');
});
</script>
Fiddle: http://jsfiddle.net/codestor/C7xj6/2/
I'm working on implementing the following functionality:
When the user clicks on 2013, the news-active class of news-container should switch to the div with the id news-2013
Any assistance would be greatly appreciated.