ScrollTop
How do I make an scrolltop?
What is a scrolltop? How do you make a scrolltop? This script and codes were developed by Soufiane Abid on 12 October 2022, Wednesday.
ScrollTop - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>ScrollTop </title> <link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <section> <div><i class="fa fa-angle-down fa-5x"></i></div> <div><i class="fa fa-arrow-down fa-4x"></i></div> <div><i class="fa fa-arrows-v fa-3x"></i></div> <div><i class="fa fa-angle-up fa-3x"></i></div>
</section>
<!-- Button ScrollTop -->
<div id="top">
<i class="fa fa-angle-double-up"></i>
</div> <script src='https://code.jquery.com/jquery-2.2.1.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
ScrollTop - Script Codes CSS Codes
/* Reset My page */
*{ margin: 0; padding: 0;
}
/* Star Section Style */
section div:first-child{ background: #cff0da;
}
section div:nth-child(2){ background: #88dba3;
}
section div:nth-child(3){ background: #dadbdb;
}
section div:last-child{ background: #3ac569;
}
/* Star Section Style */
/* button Style */
#top{ font-size: 30px; position: fixed; right:10%; bottom:20px; cursor: pointer; display: none;
}
div i:hover{ color: #5A9367;
}
/* end Button style */
ScrollTop - Script Codes JS Codes
(function($){ 'use stricte'; // Variables var $winHeight = $(window).height(), $scrollTopBtn = $('#top'), $icon = $('section > div i'); // Section Width $('section div').height($winHeight); // Resize Window function $(window).resize(function(){ $('section div').height($winHeight); $icon.css('marginTop', $winHeight - $(this).height() / 2 ); $icon.css('marginLeft', $(window).width() - $(this).width() / 2 ); });
// Scrolling $(window).scroll(function(){ // console.log($(this).scrollTop()); if ( $(this).scrollTop() >= 450 ){ $scrollTopBtn.fadeIn(); }else{ $scrollTopBtn.fadeOut(); } }); $scrollTopBtn.click(function(){ $('html,body').animate({scrollTop: 0},2000); }); // Center icon inside section $icon.css('marginTop', $winHeight - $(this).height() / 2 ); $icon.css('marginLeft', $(window).width() - $(this).width() / 2 );
}(jQuery));

Developer | Soufiane Abid |
Username | SoufianeAbid |
Uploaded | October 12, 2022 |
Rating | 3 |
Size | 2,229 Kb |
Views | 28,322 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
One click to copy | 2,034 Kb |
Sandal Adidas PURE CSS | 1,688 Kb |
Egg hover | 1,549 Kb |
Timeline CSS | 2,125 Kb |
Samatic | 1,776 Kb |
Rotation | 1,798 Kb |
Small UnderLine | 1,488 Kb |
About me Sliding | 3,722 Kb |
TTT Plans Pricing Table | 3,101 Kb |
Push Over Menu | 4,275 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
About Mazano | Kiti | 2,585 Kb |
A Pen by Michael Parenteau | Michaelparenteau | 2,133 Kb |
Scrolling Horizontal Isotope | Bramus | 2,017 Kb |
CSS Grid Overlay | Cliffpyles | 3,090 Kb |
Placeholder support for contentEditable elements, without JavaScript | Flesler | 1,863 Kb |
CSS Tooltips | Darylldoyle | 2,599 Kb |
Cars going | Netoguimaraes | 1,699 Kb |
Cartoon Bomb | Tcmulder | 4,929 Kb |
How to add Css Fold Notes In Blogger By Askwithloud.com | Askwithloud | 2,280 Kb |
Simple CSS loader. | Cabrera | 2,574 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!