Skip to content

Instantly share code, notes, and snippets.

View burhanuddin7's full-sized avatar
🎯
Focusing

Burhan Madraswala burhanuddin7

🎯
Focusing
View GitHub Profile
var tocJS = (function () {
function init() {
uiBindings();
}
var uiBindings = function () {
var parentHeading = document.querySelector('.main-page-content'), // main content
parentBlock = document.querySelector('toc list parent div'),
tocBlock = document.querySelector('TOC block parent class'),
allHeading = parentHeading.querySelectorAll('h2, h3, h4'),
@burhanuddin7
burhanuddin7 / cookie.js
Created November 8, 2022 11:04
Cookie common function for creating, deleting
@burhanuddin7
burhanuddin7 / localStorage.js
Created November 8, 2022 11:02
LocalStorage common function with try catch
var LocalStorage = (function() {
var isSupported = false;
try {
isSupported = window.localStorage ? true : false;
}
catch (error) {}
return {
isSupported: isSupported,
set: function(key, val) {
@burhanuddin7
burhanuddin7 / customLib.js
Last active November 8, 2022 10:49
Contains all the basic function stored in one file and accessed globally
var customLib = {
/**
* A native JS extend() function.
* https://gist.github.com/cferdinandi/4f8a0e17921c5b46e6c4
* Merge defaults with user options
* @private
* @param {Object} defaults Default settings
* @param {Object} options User options
* @returns {Object} Merged values of defaults and options
*/
/***
**
Ref: https://github.com/sindresorhus/devtools-detect
***/
var devtools = {
isOpen: false,
orientation: undefined,
},
threshold = 160;