Handle Resize
Optimizes window resize handling by debouncing rerendering of elements.
By Jared Malan
Fix Paragraph Runts With Nonbreaking Space
Prevent single-word runts in HTML elements with the class `.no-runt`.
By Corey Moen
Refresh after form submit
Automatically refreshes the page 7 seconds after any form submission.
By Corey Moen
Select Radio on Load
Trigger parent element click based on radio button value.
By Jared Malan
Validation - Email
Validates email format and handles invalid input on blur event.
By Jared Malan
Set localStorage
Store an array of surfer names in localStorage as a JSON string.
By Jared Malan
Number to Currency
Formats a string input as US dollar currency without decimal places.
By Jared Malan
Pointer events
CSS classes to control pointer events: .pointer-events-off disables interactions, .pointer-events-on enables interactions.
By Jared Malan
Text Highlight Color
CSS code for high-contrast text selection: black background and white text.
By Jared Malan
Print Page Button
Trigger browser print dialog on clicking element with ID 'print'.
By Digipop
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
Basic scrollTrigger setup
Animate elements based on scroll position using GSAP and ScrollTrigger.
By Digipop
Auto update copyright year
Dynamically updates an HTML element to display the current year using JavaScript.
By Digipop
Hide element if collection is empty
Hide sections based on dynamic content state using jQuery.
By Corey Moen
Bind function to window
Defines an empty global function doSomethingInAnotherFile.
By Jared Malan
Animated American Flag
Render and animate an American flag on a canvas with dynamic waving effects.
By Jared Malan
Tabs switch on hover
JavaScript code for a hover-based tab interface with dynamic content display.
By Andrea Morgan
Richtext Reset
Removes top margin of the first and bottom margin of the last child elements in a rich text container.
By Jared Malan