Archive for the ‘JQuery’ Category

Detect browser window focus

The scenario: You have a link that creates a hidden iframe which generates a file download (a pdf of the current page in my example). You have cleverly given the user some visual feedback in the form of an animated ‘waiting’ gif and you would like the clever animation to go away once the user [...]

More »

A truly versatile three column template

There are hundreds of 3 column templates out there, so what’s one more right? Well the difference here is that this one template can handle 1,2 or 3 columns, purely dependent on the existence of the columns on the html. So, if you have a CMS system and you generate a left or right column, [...]

More »

Multi Column Lists with jQuery and CSS

I found myself needing to solve this problem and some googling revealed that I was not the only one. The challenge I had was how to take a long list of items and make them wrap, creating columns, newspaper style next to each other. The closest I got was from the guys at alistapart, but [...]

More »

A really really flexible CSS layout

This is a really really flexible layout that does not make use of tables and can be used as either a 1,2 or 3 column layout by simply including or omitting the left and right columns. The content is king, so the content comes first in the html followed by the rest. The structure is [...]

More »

Simple, accessible, standards based and validated Form

We all know that tables are evil and you run the risk of being seriously uncool if you are caught using them. But when it comes to forms they really make cross browser layouts that much easier, which is why there are so many forms that use tables. In the interest of good standards based [...]

More »

jQuery Infinite Loop

After looking around for a while I could not find something that would create a closed loop effect when scrolling through options in a carousel… so i had to build it. There are a lot of gallery type carousels that will left you click left and right to navigate through, but come to a dead [...]

More »

Showing the loading icon when jQuery is waiting for a response

Here’s a very simple method of putting an overlay on the page when you are making an asynchronous call using $.ajax. As the page does not refresh, you need to alert your user that work is actually been done and that they cannot interact with the page until you have finished The css: .lightbox_bg { [...]

More »

Ajax using .Net and jQuery – Revised and improved with help from Json

I previously wrote a post outlining a simpler method of making asynchronous calls with jQuery. It turns out that in practice that method was exactly that – too simple. It works fine when you only need one value back, but if you need to work with something a little more complex then try out my [...]

More »

An undocumented selector for jQuery – Contains Word

Here’s a useful and as yet undocumented feature of jQuery’s attribute selector, the contains word feature – here’s how it works: suppose you want to select a series of elements based on a class or rel or whatever. In this case I want to select all the links with the class .mylinks – but only [...]

More »

Using jQuery to check if all radio buttons have been checked

If you find yourself needing to check if all radio button groups have been checked try this dead simple solution made possible by jQuery: $(document).ready(function() { if ($(‘:checked’).length != 5) { alert(‘Please answer all the questions..’); return false; } });

More »