Click Something Based on ID in URL
Automatically triggers a click on an element if URL hash matches "#example".
By Corey Moen
Track User Localstorage
Tracks user navigation and populates a form field with the history.
By Jared Malan
Ellipsis text
CSS class to truncate text with ellipsis when it overflows the container width.
By Jared Malan
Page Change Click Delay
Delay anchor navigation by 500ms for specific classes to allow processes like animations.
By Corey Moen
Expand text on click
Toggle visibility of text sections with "Read More" buttons using JavaScript.
By Andrea Morgan
Fetch - Post
This code sends a POST request with JSON data to a specific URL, processes the JSON response, and handles any errors.
By Jared Malan
Navbar color change depending on hovered section
Dynamically update element colors on scroll based on visible section attributes.
By Digipop
Fix Paragraph Runts With Nonbreaking Space
Prevent single-word runts in HTML elements with the class `.no-runt`.
By Corey Moen
Text Highlight Color
CSS code for high-contrast text selection: black background and white text.
By Jared Malan
Number to Currency
Formats a string input as US dollar currency without decimal places.
By Jared Malan
Bind function to window
Defines an empty global function doSomethingInAnotherFile.
By Jared Malan
Pause/Reset Video Embed on Click
Stops all iframe videos by resetting their source on '.close-video' button click.
By Corey Moen
Hide element if collection is empty
Hide sections based on dynamic content state using jQuery.
By Corey Moen
Auto update copyright year
Dynamically updates an HTML element to display the current year using JavaScript.
By Digipop
Rive Input - Create Variable by Name
Create a variable for your state machine inputs by input name.
By Jeff McAvoy
Reveal Words on Scroll
Animate text on scroll with GSAP, ScrollTrigger, and SplitType.
By Witt Langstaff
Currency to Number
Convert currency string to number by removing non-digit characters and parsing to float. Throws error for invalid input.
By Jared Malan
Fetch - Get
A JavaScript code snippet that fetches data from a URL, converts the response to JSON, and logs the data or any error to the console.
By Jared Malan