I Am Not Myself

Bills.Pay(Developer.Skills).ShouldBeTrue()

I am Officially a jQuery Convert

This just might be the most awesome JavaScript I have written in the better part of a decade.

function sortEnd() {
      $('thead th', this).each(function() {
 

        var $className = $(this).attr('class');
        var $anchor = $('a', this);
        var titleText;

        switch ($className) {
          case "headerSortUp":
            titleText = $anchor.text() + ', sorted acending';
            break;
          case "headerSortDown":
            titleText = $anchor.text() + ', sorted decending';
            break;
          default:
            titleText = $anchor.text() + ', sort by';
        }

        $anchor.attr('title', titleText);
        $anchor.attr('alt', titleText);

      });
    };

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: