What do you want to save?
Add Code snippet
New code examples
-
C# 2021-10-06 15:52:02
div element position in screen
function offset(el) { var rect = el.getBoundingClientRect(), scrollLeft = window.pageXOffset || document.documentElement.scrollLeft, scrollTop = window.pageYOffset || document.documentElement.scrollTop; return { top: rect.top + scrollTop, left... Add solution -
Javascript 2021-10-05 18:45:05
vanilla js for each element add attribute
const linksArray = Array.from(document.querySelectorAll('section a')); // we use Array.from to transform the NodeList from querySelectorAll to an array. Needs to IE11 linksArray.forEach(linkEl => { // we search for every span and em inside the link l... Add solution -
Go 2021-10-05 06:01:03
how-to-prevent-google-colab-from-disconnecting
#Set a javascript interval to click on the connect button every 60 seconds. #Open developer-settings (in your web-browser) with Ctrl+Shift+I then click #on console tab and type this on the console prompt. #(for mac press Option+Command+I) function Con... Add solution -
Javascript 2021-10-03 22:36:04
javascript resize image
const img = document.querySelector('img'); //Width and height values must be integers //Width and height are measured in pixels (px) img.width = 128; img.height = 128; //To use other type of measeures (% em) style should be edited //In this case it has to... Add solution -
Javascript 2021-10-03 20:16:04
queryselectorall
//To obtain a NodeList of all of the <p> elements in the document: const matches = document.querySelectorAll("p"); //This example returns a list of all <div> elements within the document with a class of either note or alert: const m... Add solution -
Javascript 2021-10-03 19:08:02
mozilla observer onclick
var observeDOM = (function(){ var MutationObserver = window.MutationObserver || window.WebKitMutationObserver; return function( obj, callback ){ if( !obj || obj.nodeType !== 1 ) return; if( MutationObserver ){ // define a new observer... Add solution
Best helpers
Ranking is empty