1window.onload = function() { 2 // Add event listener — https://www.sitepoint.com/javascript-media-queries/ 3 // Media query event handler 4 if (matchMedia) { 5 var mq = window.matchMedia("(min-width: 60rem)"); 6 mq.addListener(WidthChange); 7 WidthChange(mq); 8 } 910 // Media query change11 function WidthChange(mq) {12 if (mq.matches) {13 var pcscrollbar = new GeminiScrollbar({14 // querySelector method — https://www.w3schools.com/jsref/met_document_queryselector.asp15 element: document.querySelector("main"),16 autoshow: true,17 }).create();1819 // JQuery Lazy support —20 // https://github.com/eisbehr-/jquery.lazy/issues/88#issuecomment-29913810321 $(".SashaLazy").Lazy({22 appendScroll: $(pcscrollbar.getViewElement()),23 // Run method “update” of Gemini:24 // https://github.com/eisbehr-/jquery.lazy/issues/88#issuecomment-29919638825 // http://jquery.eisbehr.de/lazy/example_callback-functions26 // https://github.com/noeldelgado/gemini-scrollbar#basic-methods27 afterLoad: function() {28 pcscrollbar.update();29 }30 });31 } else {32 // For Mobile33 var mobilescrollbar = new GeminiScrollbar({34 element: document.querySelector("body"),35 autoshow: true36 }).create();3738 $(".SashaLazy").Lazy({39 appendScroll: $(mobilescrollbar.getViewElement()),40 afterLoad: function() {41 mobilescrollbar.update();42 }43 });44 }45 }4647};