What do you want to save?
Add Code snippet
New code examples
-
Other 2021-09-21 22:49:04
links and when you click on these link it will scroll the page to the respective section.
$("nav").find("a").click(function(e) { e.preventDefault(); var section = $(this).attr("href"); $("html, body").animate({ scrollTop: $(section).offset().top }); }); Add solution -
Javascript 2021-09-14 00:54:04
canvas cut path to image
// canvas related variables var canvas=document.getElementById("canvas"); var ctx=canvas.getContext("2d"); var cw,ch; var $canvas=$("#canvas"); var canvasOffset=$canvas.offset(); var offsetX=canvasOffset.left; var offsetY=can... Add solution -
Other 2021-09-04 05:06:01
simple button scrolling with this
// Select all »a« elements with a parent tag »nav« and add a function that is executed on click $('#id a').on('click', function (e) { // Define variable of the clicked »a« element (»this«) and get its hr... Add solution -
Other 2021-08-27 10:11:02
infinite scroll within a div
<script> $(function(){ $(window).scroll(function () { var $div = $(".scrollme"); var divPlacement = parseInt($div.offset().top + ... Add solution
Best helpers
Ranking is empty