%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/sakura-blog/themes/theme-business/trust/v1.1.3/assets/js/
Upload File :
Create Path :
Current File : //usr/local/sakura-blog/themes/theme-business/trust/v1.1.3/assets/js/breadcrumb.js

function onMediaQueryChange(event) {
    const q = (args) => document.querySelector(args);
    const breadcrumb = q(".breadcrumb");

    if (!breadcrumb) {
        return;
    }

    breadcrumb.style.top = '';

    const header = q(".header");
    const expectedBottom = 113;
    const rect = header.getBoundingClientRect();
    const adjustmentPx = rect.bottom - expectedBottom;

    if (adjustmentPx <= 0) {
        return;
    }

    const top = parseInt(window.getComputedStyle(breadcrumb).top, 10);
    breadcrumb.style.top = `${top + adjustmentPx}px`;
}

const isSp = window.matchMedia("(max-width: 760px)");
isSp.addEventListener("change", onMediaQueryChange);
document.addEventListener('DOMContentLoaded', function(){
    onMediaQueryChange(isSp);
    window.addEventListener('resize', function() {
        onMediaQueryChange(isSp);
    });
});

Zerion Mini Shell 1.0