jquery scroll to position
$('html, body').animate({
scrollTop: $("#grepperRocks").offset().top
});$("#button").click(function() {
$([document.documentElement, document.body]).animate({
scrollTop: $("#elementtoScrollToID").offset().top
}, 2000);
});jQuery(document).ready(function($) {
$('a[href^="#"]').bind('click.smoothscroll',function (e) {
e.preventDefault();
var target = this.hash,
$target = $(target);
$('html, body').stop().animate( {
'scrollTop': $target.offset().top-40
}, 900, 'swing', function () {
window.location.hash = target;
} );
} );
} );
Also in JavaScript:
- random number in js
- how to set view engine in express
- access-control-allow-origin nodejs express
- quicksort javascript
- react fetch data in for loop
- javascript push array
- Add object to array javascript
- callback in js
- show image javascript
- angular back button
- js no new line console.log
- jquery validation plugin google recaptcha
- javascript login system
- Javascript compare two dates
- vuejs pass all events to child
- jquery $(document.on click
- between in mongodb
- array of array key value javascript
- how to cause a whole page reload react redux
- jquery checkbox unchecked
- remove floating point javascript
- sort an array by the laster letter of element javascript
- componentdidmount in hooks
- scroll through page with javascript