Hash change logging
How do I make an hash change logging?
Console logs the identity of the current view via the hash change event.. What is a hash change logging? How do you make a hash change logging? This script and codes were developed by Heydon on 27 August 2022, Saturday.
Hash change logging - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Hash change logging</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <nav role="navigation"> <ul> <li><a href="#the-default-view">the default view</a></li> <li><a href="#some-view">some view</a></li> <li><a href="#another-view">another view</a></li> </ul>
</nav>
<main role="main"> <div id="some-view"> <h1>Some view</h1> <p>This is one of any number of views that are reachable by linking to its <code>id</code> / hash identifier.</p> </div> <div id="another-view"> <h1>Another view</h1> <p>This is one of any number of views that are reachable by linking to its <code>id</code> / hash identifier.</p> </div> <div id="the-default-view"> <h1>The default view</h1> <p>This view is visible by default when the user first arrives at the app.</p> </div>
</main> <script src="js/index.js"></script>
</body>
</html>
Hash change logging - Script Codes CSS Codes
/* basic layout */
body { font-size: 120%; font-family: sans-serif; max-width: 40em; margin: 0 auto;
}
nav { text-align: center; padding: 0.5em 0; border-bottom: 2px solid;
}
nav li { display: inline-block; margin: 0 0.5em;
}
/* view visibility logic and animation */
main > * { display: none;
}
main > *:last-child { display: block;
}
@keyframes pulse { 0% { transform: scale(1) } 50% { transform: scale(1.05) } 100% { transform: scale(1) }
}
main > *:target { display: block; animation: pulse 0.5s linear 1;
}
main > *:target ~ * { display: none;
}
Hash change logging - Script Codes JS Codes
window.addEventListener('hashchange', function() { console.log('this view\'s id is', window.location.hash.substr(1));
});
Developer | Heydon |
Username | heydon |
Uploaded | August 27, 2022 |
Rating | 3.5 |
Size | 2,134 Kb |
Views | 46,552 |
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 |
Theme color inverter with filter | 0 Kb |
Just add javascript | 2,010 Kb |
Redesigned gender form field | 1,160 Kb |
Focus management of smooth scrolling | 2,506 Kb |
DIV wormhole | 1,932 Kb |
Invert custom properties | 2,026 Kb |
Current Page Test Case | 1,827 Kb |
Controlled chaos | 1,562 Kb |
Animated focus styles for kbd users | 1,987 Kb |
Vue.js TODO List | 4,218 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 |
Michelle, submit your photography to Unsplash. | Zaneriley | 3,368 Kb |
Animated Vertical CSS3 Menu Black | MaCeLMp4 | 2,750 Kb |
DIV wormhole | Heydon | 1,932 Kb |
Toggle menu | Seyedi | 2,279 Kb |
A simple log in form made with css | Mayurelbhar | 2,160 Kb |
Intake Form Page 2 | Ijantje | 4,983 Kb |
Growing Root - Scroll control - CANVAS | Cjonasw | 2,342 Kb |
NT Tribute | Skybutterfly | 2,850 Kb |
Nice textured background | Hans | 2,659 Kb |
Birthday Party Starter | Aussieyang | 1,629 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!