Dynamic Box Shadow
How do I make an dynamic box shadow?
What is a dynamic box shadow? How do you make a dynamic box shadow? This script and codes were developed by Drew McConville on 31 August 2022, Wednesday.
Dynamic Box Shadow - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Dynamic Box Shadow</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1>Scroll to Element</h1>
<div id="el"></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>
Dynamic Box Shadow - Script Codes CSS Codes
body { min-height: 1900px; background-color: #e7eaee;
}
h1 { text-align: center; font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-weight: 300; color: #787a7f; margin-top: 200px;
}
#el { border-radius: 5px; height: 100px; width: 300px; padding: 1rem; margin: 0 auto; background-color: #FFF; margin-top: 700px; box-shadow: 0px 40px 20px 0px rgba(0, 0, 0, 0.2);
}
Dynamic Box Shadow - Script Codes JS Codes
$(document).scroll(function(){ winHeight = $(window).innerHeight(); topDif = $("#el").offset().top; elHeight = $("#el").innerHeight(), scrollTop = $(window).scrollTop(), distance = ((topDif - scrollTop) + elHeight), fromBottom = (winHeight - distance), percentScroll = (fromBottom / winHeight), pixelNum = ((percentScroll * 60) - 30) * (-1); $('#el').css('box-shadow', '0px ' + pixelNum + 'px 40px 0px rgba(0,0,0,0.2)');
})
![Dynamic Box Shadow - Script Codes](http://shots.codepen.io/drew_mc/pen/jPRdxo-512.jpg)
Developer | Drew McConville |
Username | drew_mc |
Uploaded | August 31, 2022 |
Rating | 4 |
Size | 2,407 Kb |
Views | 44,528 |
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 |
Baseball TV Scorebox | 7,270 Kb |
Avg Donation Firework Effect for Bernie 2016 project | 5,818 Kb |
Basic Hidden Form | 3,467 Kb |
Burger Style Navigation Button | 4,172 Kb |
Welcome screen using flexbox and viewport units | 2,404 Kb |
Box Shadow Evolution | 1,911 Kb |
Attempt to mimic push start on vehicle | 3,967 Kb |
Simple blog concept | 2,666 Kb |
Donation UI Concept | 7,135 Kb |
Draft Bernie Sanders Email | 3,500 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 |
Simple blog concept | Drew_mc | 2,666 Kb |
Typefaces with descriptions | Megandoty | 2,944 Kb |
C.Rowe Button | Brownerd | 2,473 Kb |
Ball physics | Blackkbot | 3,874 Kb |
Twinkling Stars | Ripley6811 | 2,750 Kb |
Hmmm... | Rk007 | 4,848 Kb |
Ball bouncing loading animation | Adam2326 | 3,144 Kb |
CSS Piano | Dannystyle | 5,138 Kb |
Gulpfile | Aimhigherwebdesign-amy | 1,765 Kb |
A Pen by John Malc | F789gh | 1,420 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!