I have integrated a horizontal scrolling date selector on my website, and it is functioning well. However, I am facing an issue while trying to change the CSS properties of a clicked date link using jQuery. Despite successfully firing the click event, I am unable to target the clicked link correctly for applying the desired CSS changes. The use of a:active or a:visited attributes does not yield the expected result either. Any assistance in resolving this problem would be greatly appreciated.
$("#datePicker a").click(function(event) {
var date = this.getAttribute("data-date");
alert('date');
//future events here
event.preventDefault();
});
#datecontainer {
background-color: #a07a3d;
position: relative;
text-align: center;
z-index: 0;
}
#datecontainer {
display: inline-block;
padding: 10px 0 16px;
vertical-align: middle;
width: 620px;
z-index: 0;
}
div.moviedatediv div.dates #date-scroller:after {
content: "";
height: 5px;
width: 100%;
background-color: #f3f3f3;
z-index: -1;
position: absolute;
left: 0px;
bottom: 0px;
}
.moviedatediv {
list-style-type: none;
margin: 0 auto;
padding: 0;
cursor: pointer;
display: inline-block;
...
...
</div>