dyScrollUpJS is a small JavaScript plugin that you can use in your website and blog to create "Scroll-to-top" button.
It's free and released under MIT License Copyright (c) 2016 Yusuf Shakeel
Include the JavaScript file in your page.
Call the init() method of dyScrollUpJS to create the scroll-to-top button.
dyscrollup.init();
Pass the following to configure.
dyscrollup.init({
showafter: 600,
scrolldelay: 500,
position: 'right',
image: 'path/to/image/32.png',
shape: 'other',
width: 30,
height: 30
});
Where,
showafter: integer
(optional) default: 300, show button after scolling X pixels down
scrolldelay: integer
(optional) default: 500, delay the scrolling up action in milliseconds
position: "string"
(optional) values: "left|right" default: "right"
image: "string"
(optional) values: "path of the image" default: ""
shape: "string"
(optional) values: "other|circle" default: "circle"
width: integer
(optional) default: 32
height: integer
(optional) default: 32
Version 2.x no jQuery required.
Version 1.x requires jQuery v1.12+
Copyright © Yusuf Shakeel
MIT License