background preloader

AutoSuggest jQuery Plugin

AutoSuggest jQuery Plugin

12Robots.com - Jason Dean: Unselecting Radio Buttons with jQuery I got a weird request from one of my internal customers today. In one of our applications he wanted to be able to "uncheck" radio buttons. We all know that if you have a group of radio buttons, like this, that once you select one option, you cannot unselect an option, you can only change from one option to another. <input type="radio" name="radio_group" />radio a<br /> <input type="radio" name="radio_group" />radio b<br /> <input type="radio" name="radio_group" />radio c<br /> Well, my customer wanted to be able to click on a checked radio button and "uncheck" it. At first, I said "No way, that's not the way that web applications work!". Here is what I came up with. <script type="text/javascript"> $(function(){ var allRadios = $('input[type=radio]') var radioChecked; var setCurrent = function(e) { var obj = e.target; radioChecked = $(obj).attr('checked'); } var setCheck = function(e) { if (e.type == 'keypress' && e.charCode ! Try it out here:

from __future__ import * » Remote JSON - JSONP The browser security model dictates that XMLHttpRequest, frames, etc. must have the same domain in order to communicate. That's not a terrible idea, for security reasons, but it sure does make distributed (service oriented, mash-up, whatever it's called this week) web development suck. There are traditionally three solutions to solving this problem. Local proxy: Needs infrastructure (can't run a serverless client) and you get double-taxed on bandwidth and latency (remote - proxy - client). Flash: Remote host needs to deploy a crossdomain.xml file, Flash is relatively proprietary and opaque to use, requires learning a one-off moving target programming langage. Script tag: Difficult to know when the content is available, no standard methodology, can be considered a "security risk". I'm proposing a new technology agnostic standard methodology for the script tag method for cross-domain data fetching: JSON with Padding, or simply JSONP. Let's take the del.icio.us JSON API as an example.

Simplest jQuery Slideshow A friend was looking at doing a simple slideshow. The requirements were very straightforward: No animation controls. eg: play, stop. Images should cross-fade. Her instinct was to find an existing jQuery plug-in and revise it to work to her needs. That would seem simple enough but if you do a search for jQuery slideshows, you'll find that there are plenty of them and they are filled with plenty of functionality. Using an existing plug-in wasn't very practical and hard to work with. I put my thinking cap on and decided to write a script from scratch. (If you're a TL;DR kinda person, check out the demo.) HTML and CSS The HTML was very straightforward: a DIV with some IMGs in it. In thinking about the CSS, I decided to just lock all the images into the same place using absolute positioning. jQuery Slideshow Now to think about the slideshow. $('.fadein img:gt(0)').hide(); You have to remember that the image index starts at 0. setInterval(function(){ },3000); $('.fadein :first-child').fadeOut()

Loading Content with JSON Introduction Thanks to the increasing use and education of efficient JavaScript techniques in today’s web applications, JSON has become the data format de jour of the enterprising young web developer. JSON is particularly useful at loading state—passing and loading data that is unique to a particular client. The question we’ve run into around here, is what is the best way to get data off of our server and into a JSON object so it can be processed by the browser? Note: Some of the example code presented below uses the JSON Parser and Prototype Framework. The Concept Just to make sure we’re all on the same page, let’s do a quick rundown of why it’s important to figure out how to load a JSON object on page load. An object is created, and the data from that object is placed into the DOM. Ajax Everyone’s favorite new candy. Once the server sends back the response, JSON.parse() then converts our string into the actual JavaScript object. What’s wrong with this method? innerHTML user = <?

W3Avenue - Advice &amp; Resources For Rapid Web Development (CSS, JavaScript, jQuery, PHP, Libraries, Resources, &amp; More...) Slimbox 2, the ultimate lightweight Lightbox clone for jQuery · digitalia.be Version: 2.05 Category: jQuery Javascripts Introduction Slimbox 2 is a 4 KB visual clone of the popular Lightbox 2 script by Lokesh Dhakar, written using the jQuery javascript library. It was designed to be very small, efficient, standards-friendly, fully customizable, more convenient and 100% compatible with the original Lightbox 2. Demo Single images Image set These are pictures I took during a journey through India and Nepal in 2008. Features From a functional point of view, Slimbox 2 has the following added features compared to the original Lightbox: Slimbox is ready to launch as soon as the document is ready. From a design point of view, Slimbox 2 is very different from Lightbox: The code is optimized to an insane level and has been written from scratch with efficiency in mind for the jQuery library instead of the huge Prototype/Scriptaculous. Slimbox 2 is currently the smallest Lightbox-like script available for the jQuery library. Compatibility Requirements Usage Setup 1. 2. Activate Download

Minimalist jQuery: 11 useful plugins under 4K | jQuery Plugins | TRIF3CTA | Austin, TX Minimalist jQuery: 11 useful plugins under 4K jQuery makes our lives easier. So much so that it's tempting to use it all the time, inadvertently slowing our page load times (cue YSlow and Hammerhead). Combining, compressing, and delivering… Read more → Characteristics of the ultimate link (for SEO purposes) The ultimate link: is useful to the reader is comprised of text is featured on a highly-trafficked and trusted site comes early in the page markup uses descriptive anchor text is… Read more → 960 pixel grid reference image Until recently, grid systems have been the domain of print designers. Read more → XHTML/CSS web forms: 5 simple techniques Technique 1: The Label Sandwich Wrap your inputs, selects, and textareas in the label element, and set them all as block-level. Read more → Add a trailing slash via .htaccess to prevent duplicate content

Glimmer - Lab - MIX Online Glimmer: a jQuery Interactive Design Tool is a prototype from the Mix Online Labs which makes jQuery accessible through a visual tool. The objective for Glimmer is pretty simple: to enable the power of jQuery through an interactive design surface. If jQuery is the "write less, do more” JavaScript library, then Glimmer is the “write none, do more” jQuery design tool. Glimmer has three core audiences: power users, designers and developers The Genesis of Glimmer Like many software projects, Glimmer was born during a conversation. In building Oomph, we used jQuery extensively, which was a new experience for both of us. While we had a good workflow, it wasn’t perfect because, if Tim wanted to make a change to the look or feel, he would have to either (1) modify the JavaScript himself or (2) have me make the change. This is when we had the following realization: what if there were a tool for designers to create amazing web experiences in HTML, CSS and JavaScript without having to write code?

Image-free CSS Tooltip Pointers - A Use for Polygonal CSS? | Filament Group, Inc. Posted by Scott on 03/03/2009 A while back, Tantek Celik released A Study of Regular Polygons, which used a little-known CSS trick to create non-rectangular shapes such as triangles and pentagons with nothing more than an ordinary HTML element. The experiment is very interesting and really cool, but the practical takeaway wasn’t immediately clear. Recently however, we've been working on building the markup for upcoming jQuery UI widgets, we came across a case that prompted us to take another look at the technique. The tooltip widget design, fairly common in websites these days, uses a small triangular "speech bubble" pointer that is typically created quite easily with a background image. The Design Approach The jQuery UI planning wiki page has several examples for the tooltips we intend to build into the library. Polygonal CSS works by setting an element's width to something small and then setting thick borders on less than 4 sides. The concept is easiest explained through a code sample.

Related: