A Pen by Jesper Hills

Developer
Size
2,738 Kb
Views
18,216

How do I make an a pen by jesper hills?

What is a a pen by jesper hills? How do you make a a pen by jesper hills? This script and codes were developed by Jesper Hills on 13 October 2022, Thursday.

A Pen by Jesper Hills Previews

A Pen by Jesper Hills - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>A Pen by Jesper Hills</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ body { height: 3000px; background: #eee;
}
p { color: #999; font: 17px/25px Arial, sans-serif; text-align: center; margin: 6em auto; max-width: 80%;
}
p b { color: black;
}
.msg { color: white; background: #333; padding: 1em; position: fixed; top: 0; left: 0;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="msg"> <b>Visible: </b><i id="a"></i> <br /> <b>Scrolled: </b><i id="b"></i>
</div>
<p>Concise method of detecting amount of visible screen relative to length of document and amount of the page currently scrolled, both in percent.<br /><br /><b>Scroll down</b> or <b>Resize window height</b></p> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

A Pen by Jesper Hills - Script Codes CSS Codes

body { height: 3000px; background: #eee;
}
p { color: #999; font: 17px/25px Arial, sans-serif; text-align: center; margin: 6em auto; max-width: 80%;
}
p b { color: black;
}
.msg { color: white; background: #333; padding: 1em; position: fixed; top: 0; left: 0;
}

A Pen by Jesper Hills - Script Codes JS Codes

// Grab the two elements to output to
var a = document.getElementById("a");
var b = document.getElementById("b");
function percent(value){ // Round up to two decimal places // output as percentile string return value.toFixed(2)+"%"
}
function calc(){ // Grab values var s = window.pageYOffset; var d = document.height; var w = window.innerHeight; // Format and output values a.innerHTML = percent( (w/d)*100 ); b.innerHTML = percent( (s/(d-w))*100 );
}
// Fire the function
calc();
window.onscroll = calc;
window.onresize = calc;
A Pen by Jesper Hills - Script Codes
A Pen by Jesper Hills - Script Codes
Home Page Home
Developer Jesper Hills
Username nopr
Uploaded October 13, 2022
Rating 4
Size 2,738 Kb
Views 18,216
Do you need developer help for A Pen by Jesper Hills?

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!

Jesper Hills (nopr) Script Codes
Create amazing web content with AI!

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!