John Cox

Blogs · @wyome · Now · Shelf

Tagged jquery · everything

Interesting

Garlic.js

Garlic.js is a lightweight JavaScript library that automatically saves form field values to the browser's localStorage, preventing data loss if a user accidentally closes their tab or browser. Implementation requires only adding `data-persist="garlic"` to form tags, and the library offers configuration options like domain-wide storage, custom callbacks for retrieval and persistence events, and conflict management between stored and database values. The minified version (~5K) requires jQuery or Zepto and is compatible with modern browsers (IE8+, Chrome 4+, Firefox 4+, Safari 4+, Opera 11+).

Permalink

Numeral.js

Numeral.js is a JavaScript library for formatting and manipulating numbers in various ways—as currency, percentages, bytes, or with custom delimiters and abbreviations. It allows you to create numeral objects from numbers or strings, format them according to preset or custom patterns, and perform basic mathematical operations like add, subtract, and difference. The library supports multiple locales and custom format definitions, making it useful for displaying numbers appropriately across different regions and use cases.

Permalink

Darsain/sly · GitHub

Sly is a jQuery-based JavaScript library that enables smooth, one-directional scrolling with multiple navigation methods including mouse wheel, dragging, touch input, and automated cycling. It uses optimized animation rendering with requestAnimationFrame and GPU acceleration for performance, while maintaining broad browser compatibility including legacy versions. The library offers a comprehensive API with numerous configuration options and methods for controlling scroll behavior and positioning.

Permalink

Uniform - Sexy forms with jQuery

JavaScript is a programming language for creating interactive browser experiences, while jQuery is a library built on JavaScript that simplifies common tasks like DOM manipulation and event handling with less code. The piece argues that jQuery isn't a separate language but rather a collection of JavaScript code designed to make development faster and easier, and recommends that developers learn both to understand when each tool is most appropriate for their projects.

Permalink

jwerty - Awesome handling of keyboard events

jwerty is a lightweight JavaScript library (1.5kb minified and gzipped) that simplifies keyboard event handling by allowing you to bind, fire, and assert key combinations using intuitive string syntax rather than the browser's native keyboard API. It supports global shortcuts, key sequences, optional key alternatives, regex-like key ranges, and element-specific bindings, with methods like `jwerty.key()` for binding callbacks, `jwerty.is()` for checking events, and `jwerty.fire()` to trigger keyboard events programmatically.

Permalink

jQuery Blog » jQuery 1.8.2 Released

jQuery 1.8.2 is a bug-fix and performance-improvement release addressing regressions from earlier 1.8 versions, with corrections to deferred objects, event handling, offset calculations, selectors, and DOM traversal. The update resolves issues affecting browser compatibility (particularly IE and mobile devices), pseudo-class selectors, and event delegation performance.

Permalink

Vintage effects for your images with HTML5 | Webdesigner Depot

vintageJS is a jQuery plugin that applies vintage and retro photo effects directly on websites using HTML5 canvas, eliminating the need to pre-process images in desktop software before uploading. The plugin offers preset filters like sepia and grayscale, plus customizable options for vignette, noise, desaturation, and other effects that can be combined to create consistent styling across user-uploaded images. This approach solves the problem of maintaining a cohesive aesthetic when clients or site visitors are regularly adding new photos without manual processing.

Permalink

Untitled (http://blog.bittersweetryan.com/2012/09/jquery-function-of-week-deferred-deep.html?spref=tw)

jQuery's Deferred object provides a way to manage callbacks for asynchronous operations, working similarly to making a phone call where you register what to do based on whether the call succeeds or fails. The article explains that Deferreds have two parts: callers (functions that initiate operations or respond to results using `when()`, `then()`, `done()`, and `fail()`) and callees (functions that return promises and eventually resolve or reject them). A real-world example demonstrates how using Deferreds to chain operations like fading out content, fetching tweets, and fading in new data keeps code decoupled and maintainable rather than nesting callbacks.

Permalink