1
我有奇怪的錯誤,並且不明白爲什麼! 可能有人可以幫助我,告訴,這裏有什麼問題。無法使用'in'運算符在.top10_month .periods中搜索'20'
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');
}
});
});
};
謝謝,這是有益的 –