2008/05/09

元々はきゃーさん所で知った「小粋空間: サイドメニュー折りたたみの動作遅延対処」をパクってやってたんですが、良く考えたらこのサイトってjQuery使ってたなぁ...と
$.each({
    tags : true,
    category : true,
    archives : true,
    comments : false,
    trackbacks : false
}, function(i) {
    var f = $('#' + i + 'name');
    f.click(function() {
        $('span', this).html(($('#' + i + 'list').css('display') != 'none') ? '▼' : '▲');
        $('#' + i + 'list').toggle('fast');
    }).css('cursor', 'pointer').append('<span>▲</span>');
    if (this == true) f.click();
});
すんなり少量のコードになりました。jQuery++
Posted at 18:00 | WriteBacks () | Edit
Edit this entry...

wikieditish message: Ready to edit this entry.






















A quick preview will be rendered here when you click "Preview" button.