产品中心
产品中心
满鼎华商用不锈钢厨房设备 — 厂家直销 · 加工定制 · 全国发货
(function() {
// 隐藏主题模板自动输出的重复标题
var dupH1 = document.querySelector('main.section .container > h1:first-child');
if (dupH1 && dupH1.textContent.indexOf('产品中心') !== -1) {
dupH1.style.display = 'none';
}
var tabs = document.querySelectorAll('#pcTabs .pc-tab');
var sections = document.querySelectorAll('.pc-section');
// URL hash 自动打开对应分类
function switchTab(filter) {
var target = document.querySelector('#pcTabs .pc-tab[data-filter="' + filter + '"]');
if (!target) return;
tabs.forEach(function(t) { t.classList.remove('active'); });
target.classList.add('active');
sections.forEach(function(sec) {
sec.style.display = (filter === 'all' || sec.getAttribute('data-cat') === filter) ? '' : 'none';
});
countVisible();
}
var hash = window.location.hash.replace('#', '');
if (hash) {
switchTab(hash);
}
var sections = document.querySelectorAll('.pc-section');
var totalEl = document.getElementById('pc-total');
function countVisible() {
var n = 0;
sections.forEach(function(sec) {
if (sec.style.display !== 'none') n += sec.querySelectorAll('.pc-card').length;
});
if (totalEl) totalEl.textContent = n;
}
tabs.forEach(function(tab) {
tab.addEventListener('click', function() {
var filter = this.getAttribute('data-filter');
switchTab(filter);
var firstVisible = document.querySelector('.pc-section:not([style*="display: none"])');
if (firstVisible) {
var y = firstVisible.getBoundingClientRect().top + window.pageYOffset - 120;
window.scrollTo({ top: y, behavior: 'smooth' });
}
});
});
})();
















