Archive for August, 2008

YUI MenuCreator : generic show/hide code

Wednesday, August 27th, 2008

At work I frequently encounter designs that utilize a mouseover show/mouseout hide menu that usually consists of a trigger (often an A tag, or LI element) and a menu (often a DIV, or a UL). Due to the browser inconsistencies between event handling and mouseout/mouseover DOM detection, it can be cumbersome to create a menu that is quick to implement (thus cost effective) and most importantly, stable. It also has support for a delay threshold, and the ability to animate show and hide events.


(more…)

Posted in Programming | No Comments »

YUI CustomEvent subscriptions

Sunday, August 10th, 2008

Recently at Ajaxian there was a post describing Custom Events and how they could be used to better structure an event-driven application by ’subscribing’ or ‘binding’ certain actions to an event. At Pint we use YUI as our main library, so I’ve ported the author’s example into a version that uses YUI.

Here is the code:

YAHOO.util.Event.onDOMReady(function() {
    document.body.event1 = new YAHOO.util.CustomEvent();
    YAHOO.util.Event.on('colorchange', 'change', function(e) {
        if (this.checked) document.body.event1.subscribe(changeColor);
        else document.body.event1.unsubscribe(changeColor);
    });
    YAHOO.util.Event.on('contentchange', 'change', function(e) {
        if (this.checked) document.body.event1.subscribe(changeContent);
        else document.body.event1.unsubscribe(changeContent);
        }
    });
    YAHOO.util.Event.on(document.getElementById('leftchoices').childNodes, 'click', function(e) {
        document.body.event1.fire(e);
    });
});

See example »

Posted in Programming | No Comments »

Skatin it up

Saturday, August 2nd, 2008

We had a blast skating at a local middle school today. We brought out a rail and even busted some roof gaps. Pictures are below.

photo

photo

photo

photo

photo

photo

Posted in My Life | No Comments »

Posting from my iphone

Friday, August 1st, 2008

Check it out!

photo

Posted in Cool | No Comments »