dyScrollUpJS
Small plugin that you can use in your website and blog to create "Scroll-to-top" button using dyScrollUpJS.
This documentation is for version 2.x of dyScrollUpJS project.
Click here to get the latest release for the GitHub repository.
Version 2.x requires no jQuery.
You can choose one of the following ways to get dyScrollUpJS.
Download the latest release version of dyScrollUpJS from its GitHub repository.
Or, you can use NPM npm install --save dyscrollupjs to install it as a dependency for your project.
npm install --save dyscrollupjs
Or, you can get it from jsDelivr CDN.
dist
For production environment you can use the compressed version found inside the dist directory.
For development purpose you can check out the uncompressed code inside the src directory.
src
Include dyScrollUpJS JavaScript file in the body tag generally at the end and then you can write some JavaScript code to initialize the plugin.
<!-- dyScrollUpJS --> <script src="path/to/dist/js/dyscrollup.min.js"> <!-- finally dyScrollUpJS initialize code --> dyscrollup.init();
The init() method of dyScrollUpJS takes an object an argument. Following are the properties and their respective values that you can set.
init()
"auto"
<!DOCTYPE html> <html> <head> <title>Index Page</title> </head> <body> <!-- put your content here --> <!-- javascript --> <script src="path/to/dist/js/dyscrollup.min.js"></script> <!-- init dyscrollup --> <script> dyscrollup.init(); </script> </body> </html>
In the above code we are including the dyScrollUpJS JavaScript file and then initialising it with the default configuration.
<!DOCTYPE html> <html> <head> <title>Index Page</title> </head> <body> <!-- put your content here --> <!-- javascript --> <script src="path/to/dist/js/dyscrollup.min.js"></script> <!-- init dyscrollup --> <script> dyscrollup.init({ showafter : 600, scrolldelay : 500, position : "left", image : "dist/image/32.png", shape : "other", width : 30, height : 30 }); </script> </body> </html>
In the above example we are including the dyScrollUpJS JavaScript file and passing our own configurations.