![]()
@@ -692,17 +698,42 @@
}
});
- // Interactive Hover Cards — Mouseenter transfers active class to hovered card
- document.querySelectorAll('.sis-hover-card').forEach(function (card) {
- card.addEventListener('mouseenter', function () {
- var parentRow = card.closest('.row');
+ // Interactive Hover Cards — Mouseover event delegation to apply active class dynamically
+ document.addEventListener('mouseover', function (e) {
+ var card = e.target.closest('.sis-hover-card, .sis-hover-card-v2');
+ if (card && !card.classList.contains('active')) {
+ var parentRow = card.closest('.row') || card.parentElement;
if (parentRow) {
- parentRow.querySelectorAll('.sis-hover-card').forEach(function (c) {
+ parentRow.querySelectorAll('.sis-hover-card, .sis-hover-card-v2').forEach(function (c) {
c.classList.remove('active');
});
}
card.classList.add('active');
- });
+ }
+ });
+
+ // Apply Custom Attributes (e.g. data-aos="fade-up" style="background:#fff") dynamically
+ document.querySelectorAll('[data-custom-attrs]').forEach(function (el) {
+ var attrStr = el.getAttribute('data-custom-attrs');
+ if (attrStr && attrStr.trim() !== '') {
+ var tempDiv = document.createElement('div');
+ tempDiv.innerHTML = '
';
+ var tempEl = tempDiv.firstElementChild;
+ if (tempEl) {
+ Array.from(tempEl.attributes).forEach(function (attr) {
+ if (attr.name === 'class') {
+ attr.value.split(/\s+/).filter(Boolean).forEach(function (c) {
+ el.classList.add(c);
+ });
+ } else if (attr.name === 'style') {
+ el.style.cssText += ';' + attr.value;
+ } else {
+ el.setAttribute(attr.name, attr.value);
+ }
+ });
+ }
+ el.removeAttribute('data-custom-attrs');
+ }
});
});