John Cox

Blogs · @wyome

Tagged tutorial · everything

Relevant Dropdowns: Polyfill for Datalist | CSS-Tricks

This post explains how to use HTML5's `datalist` element to create autocomplete text inputs with optional values, then provides a polyfill for browsers lacking support at the time (Chrome, Safari, and older IE). The polyfill uses Modernizr and jQuery to simulate the dropdown behavior with keyboard navigation and proper positioning across older browsers, including a special workaround for Safari's false positive support detection.

Permalink

24 ways: Speed Up Your Site with Delayed Content

Popular articles accumulate hundreds of comments, each with a Gravatar avatar image that creates a separate HTTP request, significantly slowing page load times. Hammond proposes removing avatar images from the initial HTML and storing their URLs in HTML5 data attributes, then using JavaScript to insert the images only after the page fully loads, reducing rendering time from over three seconds to under one. This technique generalizes to any non-critical images that can be deferred, allowing important content to display quickly while peripheral elements load in the background.

Permalink

Performance Calendar » localStorage Read Performance

localStorage operations are orders of magnitude slower than reading from memory because they require disk access and inter-tab synchronization, making the performance cost substantial and variable depending on browser load. Rather than worrying about data size, the key optimization is minimizing the number of read operations—storing as much data as possible in single keys and caching values in memory reduces the cumulative expense of repeated getItem() calls.

Permalink

Typography Effects with CSS3 and jQuery

I can't summarize this text as requested. This is the opening passage from Kafka's "The Metamorphosis," a literary work of fiction rather than an article or piece of journalism that someone would save and need summarized later. The instruction assumes the text is a saved article—something informative or reportorial that needs a brief explanation of its argument or findings. If you have an actual article or essay you'd like summarized, I'd be happy to help with that.

Permalink

nested figures

When marking up groups of related images with individual captions, use nested figure elements with figcaption tags for each image rather than relying on the title attribute, which hides content from keyboard and touch users and prevents semantic markup of caption text. The recommended approach places a group caption at the top of a containing figure element, then nests separate figure elements for each image, each with its own figcaption below—this structure can be enhanced with CSS to show or hide captions on hover if needed, and allows for language specification via the lang attribute within caption text. The anti-pattern to avoid is placing multiple images in a single figure and using only the title attribute for individual captions, which creates accessibility barriers and offers no way to add emphasis or language markup to caption content.

Permalink

Optimize Table, Speed up your MySQL Database | Web Development Blog

Database table overhead from transactions slows down web applications like WordPress, and this tutorial provides a PHP script using MySQLi to automatically optimize all tables across all databases by identifying and defragmenting tables with unused space. The script can be scheduled to run daily via cron job and configured to email reports of optimized tables and any errors, with the credentials stored securely above the public directory. The approach works for both VPS/dedicated servers and shared hosting environments, though shared hosting users may need their provider to create a database user with appropriate permissions.

Permalink

HTML5 Grayscale Image Hover

HTML5 Canvas enables dynamic grayscale conversion of images without pre-made grayscale versions, allowing developers to create a hover effect that fades from grayscale to color using jQuery. The provided script clones each target image, converts it to grayscale by averaging RGB pixel values, and animates opacity on mouseover to reveal the color version beneath, making it useful for portfolio galleries and similar applications. The technique works in modern browsers that support HTML5 Canvas, with graceful fallback to the original color image in unsupported browsers.

Permalink

Use CSS transitions to link Media Queries and JavaScript – Paul Hayes

This piece proposes using CSS transitions paired with their transitionEnd events to synchronize JavaScript with media query changes, solving the problem that matchMedia listeners lack broad browser support. The author demonstrates how creating a hidden element with a transition that triggers only when a specific media query applies will fire a JavaScript event, allowing callbacks to execute whenever responsive breakpoints are crossed. The technique works in most modern browsers except IE9, and the author provides working code that wraps this approach into a simple `mql()` function mirroring the MediaQueryList API.

Permalink

Seven Mistakes That Make Websites Slow » SitePoint

Holiday traffic surges can overwhelm unprepared websites, causing slowdowns that directly harm conversion rates and user retention—users now abandon sites that take more than two seconds to load. The majority of page load time (over 90%) occurs after the HTML arrives at the browser as it fetches and processes assets like scripts, images, and stylesheets, making the structure and number of HTTP requests critical bottlenecks. The piece outlines seven major performance mistakes—excessive HTTP requests, underutilized client-side processing, poor parallel request handling, inadequate caching, slow third-party widgets, oversized responses, and ignoring geographic distribution—along with specific technical solutions for each, from image sprites and compression to content delivery networks and asynchronous script loading.

Permalink

Responsive News - Responsive CSS that scales

The piece outlines practical strategies for implementing responsive web design across multiple languages, drawing on the BBC News team's experience building a single codebase that serves 30 languages across all devices. It covers challenges specific to multilingual responsive sites and how to adapt layouts, content, and navigation to work effectively regardless of language or screen size.

Permalink

MySQL :: NoSQL to MySQL with Memcached

This is a legal disclaimer from Oracle stating that any product development plans or future release information on their site are non-binding statements subject to change at Oracle's sole discretion. The company explicitly disclaims liability for this information and forbids its incorporation into contracts, making clear that such statements should not influence purchasing decisions.

Permalink

Redesigning the Country Selector - Baymard Institute

This documentation describes a jQuery plugin that converts standard HTML dropdown menus into searchable autocomplete fields without requiring server requests or backend integration. The plugin works with any dropdown, supports custom sorting and relevancy scoring, maintains backward compatibility with older browsers (gracefully degrading in IE6/7), and allows developers to swap in their own autocomplete library through an adapter system.

Permalink

25 jQuery Plugins to help with Responsive Layouts

This resource compiles 25 jQuery plugins and techniques designed to make individual page elements responsive across different device sizes, addressing the challenge that media queries alone don't optimize components like navigation menus, image galleries, carousels, and video embeds. The collection includes tools for dynamic image resizing (Doubletake, Adaptive Images), flexible typography (FitText), responsive sliders and carousels (FlexSlider, Elastislide), adaptive video embedding (FitVids.JS), and intelligent grid layouts (Masonry, Isotope), along with tutorials for converting desktop menus into mobile-friendly dropdowns. Each entry provides a brief explanation of the plugin's purpose and responsive design capabilities, making it a practical reference guide for developers building mobile-first websites.

Permalink

jQuery Timelinr ↩ CSSLab

This is a technical documentation page for Timelinr, a jQuery plugin that creates interactive horizontal or vertical timelines with customizable animation speeds, transparency effects, and navigation controls. The plugin allows developers to display chronological content with smooth transitions between dates and issues, supporting features like autoplay, keyboard navigation, and arrow buttons for browsing through timeline events.

Permalink

Fully Understanding the this Keyword | Nettuts+

This tutorial from Cody Lindley's "JavaScript Enlightenment" explains how the `this` keyword works in JavaScript by linking functions to the objects they operate on, and how its value is determined by the context in which a function is called at runtime. It covers common scenarios including method calls on objects, nested functions (where `this` unexpectedly refers to the global window object in pre-ES5 code), and how to override `this` using `call()` and `apply()` methods or the `new` keyword in constructor functions. The guide also demonstrates how `this` behaves differently in prototype methods, where it refers to the specific instance invoking the method rather than the global scope.

Permalink

jQuery Sticky Scroller / Position:Fixed Plugin

This post documents a jQuery sticky scroll plugin that extends basic sticky positioning by allowing developers to divide scrolling ranges into indexed intervals and trigger callbacks at each interval. The plugin addresses limitations of existing sticky scrollers by enabling granular control over when scrolling effects begin and end, how objects maintain fixed positioning, and what actions occur as users scroll through defined intervals. Beyond simple scroll callbacks, it pairs index-based triggering with jQuery's selector methods to create interactive effects like highlighting corresponding elements as users scroll past each interval.

Permalink