Struggling with where to start on this one, apologies for not much code.
Using slide toggle to display a div
when a
is clicked.
a
currently has a background image with a defined position. I've created a sprite image, so that when the link is clicked, the background position will change to show a downwards pointing arrow (like a typical expanding list.)
How can I build into the function that when a
is clicked, a class of arrowDown
is added?
I'd like to add a class to this link:
<a>See opening times</a>
CSS needing to be added using classname arrowDown
a.arrowDown
{
background-position: 2px -9px;
}
Function:
$('.timeList a').click(function(e) {
$(this).next().slideToggle('slow');
});