The above snippet is a solution we used to start an enumeration list in Latex from the number zero (0). We wanted to avoid adding new packages and the above solution worked out for us.
Recently, we needed to perform an infinite scroll on a website so that it would load all of its resources (both text and images). As the website was too long and it would take hours to manually scroll little by little, we used the Firefox console and JavaScript to perform the scroll without any additional plugins.
To do so we followed these steps: First we pressed the F12 button to enable the build-in console of Firefox.
Then, we typed allow pasting in the console to enable the ability to paste code directly into the console editor. Once we did that, we deleted the text allow pasting as it would create a problem once we run our code later on.
Following, we pasted the following code which both defines the function that performs the infinite scroll and the call that starts it.
//To avoid naming conflicts, give a non common names to the function and variable
var bytefreaksTimeout;
function bytefreaksScroll() {
window.scrollBy(0,1);
bytefreaksTimeout = setTimeout(bytefreaksScroll,10);
}
bytefreaksScroll();
As you will see in the following video, the scrolling was working flawlessly, once the scrolling reached the place we needed it to we used the following line in the console to stop the scrolling.
Recently we were investigating an issue on a live website at which some images were not loading. After some testing we saw that only pictures that were visible while loading the page were being loaded as well. Checking the console we found the following JS error:
Uncaught TypeError: a.browser is undefined jQuery 2
jquery.fancybox-1.3.4.min.js:1:205
NOK => browserDetect::addBrowserClassToBody => TypeError: t.browser is undefined tc-scripts.min.js:1:81903
We did not want to waste time on debugging this so we disabled the Load images on scroll option to get the site live asap. To do so, first we clicked on the Customize button on the admin bar:
Once the menu loaded, we clicked on the Advanced Options button:
From there, we clicked on Website Performances :
And got the following options
As seen in the image below, we disabled (among other changes) the option Load images on scroll
After pressing the Publish button, we reloaded the site, the JavaScript error was still there but the images were loading as expected.