Moving Circle on scroll
How do I make an moving circle on scroll?
When you scroll the page the circle behind the white div wil rotate. What is a moving circle on scroll? How do you make a moving circle on scroll? This script and codes were developed by Omran Abazid on 15 September 2022, Thursday.
Moving Circle on scroll - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Moving Circle on scroll</title> <link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="circle">
</div>
<div class="rect"> hello
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Moving Circle on scroll - Script Codes CSS Codes
div.circle{ position:fixed; top:5px; left:5px; width:968px; height: 968px; background-color: #e7a61a; border-radius:968px; border:50px dotted white; z-index:0;
}
div.rect{ position:absolute; top:5px; left:91px; width:800px; height: 2000px; background-color: white; z-index:1; -webkit-box-shadow: 1px 2px 28px -2px rgba(0,0,0,0.75);
-moz-box-shadow: 1px 2px 28px -2px rgba(0,0,0,0.75);
box-shadow: 1px 2px 28px -2px rgba(0,0,0,0.75);
}
Moving Circle on scroll - Script Codes JS Codes
$(document).ready(function(){ var bodyHeight = $("body").height()-$(window).height(); window.onscroll = function() { //Determine the amount to rotate by. var deg = -window.scrollY*(360/bodyHeight); $(".circle").css({ "transform": "rotate("+deg+"deg)", }); };
});
Developer | Omran Abazid |
Username | OmranAbazid |
Uploaded | September 15, 2022 |
Rating | 3 |
Size | 2,006 Kb |
Views | 24,288 |
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 |
Twitch API Template | 3,530 Kb |
Bootstrap page Header Template | 3,140 Kb |
A Pen by Omran Abazid | 1,522 Kb |
Weather App | 2,596 Kb |
Wikipedia Search using the API | 3,176 Kb |
Pomodora Timer | 2,624 Kb |
Simon Game without jquery | 3,370 Kb |
Simple Jquery Calculator | 2,462 Kb |
Tic tac toe | 3,323 Kb |
FCC Campers News | 2,535 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 |
Material Design-Layout-Principles Practice | Fraina | 2,331 Kb |
About Us | Francescaedits | 1,902 Kb |
Form Labels | Bartuc | 2,717 Kb |
A Pen by lizz | Lizz | 10,068 Kb |
Elon Musk - Tribute Page - FreeCodeCamp | Yunnimun | 8,615 Kb |
Awesome Full Page Menu Nav | Ey_intuitive | 4,194 Kb |
Test | Dviate | 2,668 Kb |
Day 1 - Portfolio | Chpecson | 3,532 Kb |
Buttons for autumn | Nikazawila | 1,795 Kb |
A Pen by Jay | Jaycode | 3,784 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!