Home & blog  /  2010  /  May  /

Calendar and date-picker

posted: 30 May '10 09:15 tags: Javascript, calendar, date, jQuery

Just posted a calendar/date-picker plugin I've been working on for some weeks. In short, it aims to be the most versatile and easy-to-integrate plugin of its kind, and it's the one I use on the right of this page.

It's just one file (including all styling - no separate CSS files), and you have full control over:

- what fields should wake up/hide the calendar on focus in/out, or should it always be visible?

- what dates are displayed (particular ones? Future only? Past only)

- what happens when a date is clicked (write the date to a text field? Pass it to a callback function? Assign it to a variable?)

...and much more.

Head over here to download, get usage info or view a demo.

post a comment

Domscripter - reduce your DOM-scripting code

posted: 28 May '10 13:00 tags: Javascript, DOM-scripting, form

Urgh - is it me or does native DOM-scripting require a lot of lines of code? Imagine creating a link and giving it a class and an href; that's one line to create the element, one to give it a text node, two more to apply the href and and class and one more to append it.

Hence I wrote domscripter, a powerful tool for creating HTML elements en-masse. In one function call you stipulate the element you want to create, where it should live in the DOM, what properties it should have, what assistance elements should be created at the same time (e.g. a label for a form field), and more.

Head over here to download, get usage info or view a demo.

1 comments | post new

MSThis - simulate W3C events in IE

posted: 26 May '10 10:14 tags: Javascript, IE, event, W3C

Just posted a script I wrote which aims to tackle the age-old problem of IE registering events on Window rather than on the event trigger element.

This has long caused Javascript developers headaches since it means that, in event callbacks, the 'this' keyword does not point to the trigger element like it does in the W3C standard.

MSThis rectifies that, simulating W3C event-handling in IE. It works by storing an event handler on an element, then firing them as methods of it. Frameworks like jQuery probably do something similar to harmonise W3C vs. MS event implementations.

Head over here to download, get usage info or view a demo.

post a comment

Lightbox and lightbox dialog

posted: 25 May '10 18:03 tags: Javascript, lightbox, dialog, jQuery

Just posted this. It's a standard lightbox, which runs on a jQuery selector, but more interestingly it's also a lightbox-assisted simulator for in-built browser dialog methods. You have full control over how your dialogs look and act. Here's a demo for a confirm():

1lbdialog({

2     content: "Go to Google?",

3     OKButton: {

4         text: "Yeah, OK",

5         callback: function() {

6             location.href = "http://www.google.co.uk"

7         }

8     },

9     cancelButton: {

10         text: "No, not now"

11     }

12});

Head over here to download, get usage info or view a demo.

post a comment
older posts >