Banner active page active tab js
Sun Sep 24 2023 16:17:42 GMT+0000 (Coordinated Universal Time)
Saved by
@sagarmaurya19
jQuery(function ($) {
$(".hs_banner .column .item a")
.click(function (e) {
var link = $(this);
var item = link.parent(".item");
if (item.hasClass("active")) {
item.removeClass("active").children("a").removeClass("active");
} else {
item.addClass("active").children("a").addClass("active");
}
if (item.children(".tab-wrap").length > 0) {
var href = link.attr("href");
link.attr("href", "#");
setTimeout(function () {
link.attr("href", href);
}, 300);
e.preventDefault();
}
})
.each(function () {
var link = $(this);
if (link.get(0).href === location.href) {
link.addClass("active").parents(".item").addClass("active");
return false;
}
});
});
content_copyCOPY
Comments