I have strange error, and don't understand why! May be somebody can help me and tell, what wrong is here.
Page.contentSort = function () {
var $eachblocks = (".top10_month .periods");
var $blockhead = $(".block-head__link");
$blockhead.on("click", function (e) {
var $this = $(this);
var sortvalue = $this.attr("data-date");
e.preventDefault();
$this.parents("ul").find("a").removeClass("active");
this.className += " active";
$.each($eachblocks, function () {
if ($eachblocks.attr("data-period") === $(".block-head__link.active").attr("data-date")) {
$(this).addclass("active");
} else {
$eachblocks.removeClass('active');
}
});
});
};