PageSourceSearch

https://busytoddler.com/wp-content/cache/min/1/wp-content/themes/busy-toddler/js/global.js?ver=1790617837

js busytoddler.com collected 2026-10-03 19:01:58 UTC 5,199 bytes, 27 lines download raw bytes

1/**
2 * This script adds the jquery effects to the Busy Toddler Theme.
3 *
4 * @package Busy Toddler
5 * @author  AnchoredDesign
6 * @license GPL-2.0-or-later
7 */
8if(window.innerWidth>960){updateSiteHeader()}else{setTimeout(function(){var ffForms=document.querySelectorAll('[data-ff-el="root"] form');ffForms.forEach(ffform=>{ffform.setAttribute('novalidate','')})},4000)}
9var topheight=document.querySelector('.site-header').clientHeight+27;var headerhtml=document.querySelector('.site-header').outerHTML;document.addEventListener('scroll',function(e){lastKnownScrollPosition=window.scrollY;var headerplc=document.getElementsByClassName('headerplace');if(lastKnownScrollPosition>100&&window.innerWidth>700){document.querySelector('body').classList.add('sticky')}else if(lastKnownScrollPosition>topheight&&window.innerWidth<700){document.querySelector('body').classList.add('sticky')}else{document.querySelector('body').classList.remove('sticky')}
10if(window.innerWidth>1023){updateSiteHeader()}
11if(window.innerWidth<700){updateSiteHeader()}});function updateSiteHeader(){var topheight=0;var adminbar=document.getElementsByClassName('admin-bar');if(adminbar.length>0){topheight=topheight+32}
12var topbar=document.getElementsByClassName('top-bar');if(topbar.length>0){topbar[0].style.top=topheight+'px';topheight=topheight+topbar[0].offsetHeight}
13var siteheader=document.getElementsByClassName('site-header');if(siteheader.length>0){siteheader[0].style.top=(topheight-2)+'px'}
14if(window.innerWidth>1023){var stikckyheader=document.getElementsByClassName('sticky-header');if(stikckyheader.length>0){stikckyheader[0].style.top=(topheight-2)+'px';siteheader[0].style.top='0px'}}};window.onload=function(){toggleElements()}
15function toggleElements(){var searchicons=document.querySelectorAll('.searchicon');searchicons.forEach(function(searchicon){searchicon.addEventListener('click',function(event){searchicon.classList.toggle("active");var searchform=searchicon.nextElementSibling;searchicon.nextElementSibling.classList.toggle("active");searchform.animate({duration:500,easing:'ease-in-out',fill:'forwards'})})});var toctoggles=document.querySelectorAll('.toc-toggle');toctoggles.forEach(function(toctoggle){toctoggle.addEventListener('click',function(event){event.target.innerHTML="VIEW MORE";toctoggle.parentNode.classList.toggle("expanded");if(toctoggle.parentNode.classList.contains('expanded')){event.target.innerHTML="VIEW LESS"}})});var menutoggles=document.querySelectorAll('.menu-toggle,.sub-menu-toggle,.category-menu-toggle');menutoggles.forEach(function(menutoggle){menutoggle.addEventListener('click',function(event){var el=event.target;el.classList.toggle("activated");el.nextElementSibling.classList.toggle("active")})})}
16var speed=500;var moving_frequency=15;var links=document.getElementsByTagName("a");var href;for(var i=0;i<links.length;i++){href=links[i].attributes.href===undefined?null:links[i].attributes.href.nodeValue.toString();if(href!==null&&href.length>1&&href.substr(0,1)=="#"){links[i].onclick=function(){var element;var href=this.attributes.href.nodeValue.toString();if((element=document.getElementById(href.substr(1)))){smoothScrollingTo(href.substr(1))}
17return!1}}}
18var getScrollTopElement=function(e){var top=0;while(e.offsetParent!=undefined&&e.offsetParent!=null){top+=e.offsetTop+(e.clientTop!=null?e.clientTop:0);e=e.offsetParent}
19return top};var getScrollTopDocument=function(){return document.documentElement.scrollTop+document.body.scrollTop};function smoothScrollingTo(target){var targetele=document.querySelector('#'+target);var hop_count=speed/moving_frequency;var getScrollTopDocumentAtBegin=getScrollTopDocument();var stickyheader=document.getElementsByClassName("sticky-header");var gap=(getScrollTopElement(targetele)-getScrollTopDocumentAtBegin)/hop_count;if(stickyheader.length){gap=(getScrollTopElement(targetele)-getScrollTopDocumentAtBegin-150)/hop_count}
20for(var i=1;i<=hop_count;i++){(function(){var hop_top_position=gap*i;setTimeout(function(){window.scrollTo(0,hop_top_position+getScrollTopDocumentAtBegin)},moving_frequency*i)})()}}
21if(location.hash){smoothScrollingTo(location.hash)}
22function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString()}else var expires="";document.cookie=name+"="+value+expires+"; path=/"}
23function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length)}
24return null}
25function eraseCookie(name){createCookie(name,"",-1)}
26var noticeele=document.querySelector('.store-notice');if(noticeele){var noticeID=noticeele.getAttribute('noticeId')||'';var cookieName='store_notice'+noticeID;if('hidden'===readCookie(cookieName)){noticeele.style.display='none'}else{noticeele.style.display='block'}
27var noticeeledismiss=document.querySelector('.store-notice .store-notice__dismiss-link');if(noticeeledismiss){noticeeledismiss.addEventListener('click',function(event){createCookie(cookieName,'hidden',1);noticeele.style.display='none';event.preventDefault()})}}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.