I am making a page with image coupons for each month of the year & I would like to highlight what coupon is current. The coupons range from May to April the following year. The page will go live from May this year.
HTML
<div id="blue-colum" class="monthly-coupon-column">
<ul>
<li><img class="month-offer" src="images/monthly-online-offers/coupon-may-2014.png" width="312" height="240" alt="May 2014 Coupon" /></li>
<li><img class="month-offer" src="images/monthly-online-offers/coupon-august-2014.png" width="312" height="240" alt="August 2014 Coupon" /></li>
<li><img class="month-offer" src="images/monthly-online-offers/coupon-november-2014.png" width="312" height="240" alt="November 2014 Coupon" /></li>
<li><img class="month-offer" src="images/monthly-online-offers/coupon-february-2015.png" width="312" height="240" alt="February 2015 Coupon" /></li>
</ul>
</div>
<div id="pink-colum" class="monthly-coupon-column">
<ul>
<li><img class="month-offer" src="images/monthly-online-offers/coupon-june-2014.png" width="312" height="240" alt="June 2014 Coupon" /></li>
<li><img class="month-offer" src="images/monthly-online-offers/coupon-september-2014.png" width="312" height="240" alt="September 2014 Coupon" /></li>
<li><img class="month-offer" src="images/monthly-online-offers/coupon-december-2014.png" width="312" height="240" alt="December 2014 Coupon" /></li>
<li><img class="month-offer" src="images/monthly-online-offers/coupon-march-2015.png" width="312" height="240" alt="March 2015 Coupon" /></li>
</ul>
</div>
<div id="green-colum" class="monthly-coupon-column">
<ul>
<li><img class="month-offer" src="images/monthly-online-offers/coupon-july-2014.png" width="312" height="240" alt="July 2014 Coupon" /></li>
<li><img class="month-offer" src="images/monthly-online-offers/coupon-october-2014.png" width="312" height="240" alt="October 2014 Coupon" /></li>
<li><img class="month-offer" src="images/monthly-online-offers/coupon-january-2015.png" width="312" height="240" alt="January 2015 Coupon" /></li>
<li><img class="month-offer" src="images/monthly-online-offers/coupon-april-2015.png" width="312" height="240" alt="April 2015 Coupon" /></li>
</ul>
</div>
Obviously my JQuery skills need improvement. This seems to .addClass but it is selecting the 2015 version. I am aware we have not reached May date yet.
SCRIPT
<script type="text/javascript">
$(function () {
var currentMonth = (new Date).getMonth();
if (currentMonth) {
$(".month-offer").addClass("this-month");
}
});
</script
CSS
.month-offer.this-month
{
transform:scale(1.05);
}