Friday, January 22, 2010

jQuery 1.4 Give Us a New Way to Zebra Stripe

In jQuery 1.4 all setter methods have been extended to take in a setter function.  Before only .attr() had the ability to use a function to return the value to set. Now you can pass a setter function to .css(), .attr(), .val(), .html(), .text(), .append(), .prepend(), .before(), .after(), .replaceWith(), .wrap(), .wrapInner(), .offset(), .addClass(), .removeClass(), and .toggleClass().

The setter function can take two arguments, the index position of the element in the set and the old value of the element.

.css( propertyName, function(index, value))

With setter functions now available we can use this in a new way to zebra stripe a set of elements.  In this example we'll stripe a unordered list:

HTML:

<ul>
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
<li>item 4</li>
<li>item 5</li>
<li>item 6</li>
<li>item 7</li>
</ul>
jQuery 1.4:

$(document).ready(function(){
$("li").css("background-color", function(i){
return (i % 2 === 0) ? "#cccccc": "#FFFFFF";
});
});

We select all the LIs and call the .css() setter method. We give it the property name we want to update, background-image and we pass a function that will return the value we want to set.

The function tests if the index that we passed in i is MOD 2 (simply is it even or odd), if even set the color to #cccccc else set it to #FFFFFF.

Demo: (jsbin)

Note: Obviously, this isn't the best way to do zebra stripping with jQuery but I like to explore different ways to do the same thing to learn the techniques.

Monday, January 18, 2010

14 Days of jQuery - Behind the Scenes - yayQuery

14 Days of jQuery - Behind the Scenes - yayQuery from Ralph Whitbeck on Vimeo.

yayQueries Paul Irish steals my flip and records some video while we were out eating after day two of video recording.

Saturday, January 16, 2010

14 Days of jQuery - Behind the Scenes - Part 7

14 Days of jQuery - Behind the Scenes - Part 7 from Ralph Whitbeck on Vimeo.

The team feverishly works to get the Day 2 blog out before the stroke of midnight, everyone that is except...

Friday, January 15, 2010

14 Days of jQuery - Behind the Scenes - Part 6

14 Days of jQuery - Behind the Scenes - Part 6 from Ralph Whitbeck on Vimeo.

Ralph and Elijah are recording 6 podcasts while everyone is together. Here we are talking with Mike Hostetler and Jonathan Sharp about appendTo for a future episode.

14 Days of jQuery - Behind the Scenes - Part 5

14 Days of jQuery - Behind the Scenes - Part 5 from Ralph Whitbeck on Vimeo.

John Resig, Jonathan Sharp and Richard Worth are doing final sound checks. Here's a look at the set up.

Thursday, January 14, 2010

14 Days of jQuery - Behind the Scenes - Keynote

14 Days of jQuery - Behind the Scenes - Keynote from Ralph Whitbeck on Vimeo.

This is a look at the production team behind the keynote.

14 Days of jQuery - Behind the Scenes - Part 4

14 Days of jQuery - Behind the Scenes - Part 4 from Ralph Whitbeck on Vimeo.

Richard D. Worth and Jonathan Sharp are setting up the room for our live uStream with John Resig and other members of the jQuery team

14 Days of jQuery - Behind the Scenes - Part 3

14 Days of jQuery - Behind the Scenes - Part 3 from Ralph Whitbeck on Vimeo.

The team is finallizing the 1.4 release blog post. Heads are down and working feverishly to get it out.

14 Days of jQuery - Behind the Scenes - Eric Passmore

14 Days of jQuery - Behind the scenes - Eric Passmore from Ralph Whitbeck on Vimeo.

We sat down with Eric Passmore, Aol's Senior Vice President, Global Publishing Systems and talked about Aol. use of jQuery and thank him for the use of the facility.

14 Days of jQuery - Behind the Scenes - Part 2

14 Days of jQuery - Behind the Scenes - Part 2 from Ralph Whitbeck on Vimeo.

The team is finally together and waiting to head out to dinner.

Wednesday, January 13, 2010

14 Days of jQuery - Behind the Scenes - Part 1

14 Days of jQuery - Behind the Scenes - Part 1 from Ralph Whitbeck on Vimeo.

The team that came early is testing the video equipment at Richard D. Worth's house.

Heading to DC for the 14 Days of jQuery

I am currently sitting in the JetBlue terminal in JFK. I am on my way to Washington DC where I will meet most of the rest of the jQuery team and my jQuery Podcast cohost Elijah Manor.

We are going to be working on filming the talks and releases for the 14 Days of jQuery which starts tomorrow.

Elijah and I will be podcasting like mad men. Tomorrow we plan to interview John Resig about the jQuery 1.4 release and we do plan to release that episode on Friday. In addition to that episode we are planning to record four other episodes with other team members which we will release in the coming weeks. So much to look forward too.

Additionally to all the podcasting and video production for the 14 Days of jQuery, I'll be taking video's of "behind the scenes" and uploading them to ralphwhitbeck.com, so check back often or follow @jQueryPodcast Twitter account to see when new videos are posted.

The team is pretty excited to be able to bring the 14 Days of jQuery (not to mention a little tired) but I hope the community gets tons of value from all this work.

Saturday, January 02, 2010

Getting "Up-to-speed"

I was looking over my blog this week while I was out on holiday vacation and noticed I haven't posted a blog post since October.  So much has happened since then I think perhaps a "getting the reader up-to-speed" post is in order.  

So here we go...

jQuery Team member

Early last year, I made it a goal to blog, tweet and personally evangelize jQuery to better myself and the project.  My efforts got noticed by jQuery Evangelist Rey Bango and he brought me in as a advisor to the jQuery team.  While I was an advisor I took advantage of my situation and jumped in on projects the team was working on.  Mainly, the jQuery Conference in September and the Stack Overflow Dev Days talk in Toronto.

In November, it was voted on by the jQuery team to bring me on as a jQuery Team Member and I was added to the evangelism team.  I was truly surprised and honored by this action as I wasn't expecting it at the time. 

Being a team member made it easier for me to launch my new project...

The Official jQuery Podcast

I announced in October, at Stack Overflow Dev Days in Toronto, that I would be starting the Official jQuery Podcast in November.  I worked with the jQuery team to get infrastructure support and found a cohost, in Elijah Manor, that could give an outsiders perspective on topics.

We initially started with streaming the shows live on uStream.  But I think I am finding that to be too stressful and am reevaluating whether that is still viable.  Maybe at a later date.

Our first show, with guest John Resig, got the show ranked to #2 on the top Technology podcasts for the day which was very exciting.

We've since had guests Richard D. Worth, Paul Irish, Cody Lindley and Rey Bango.

Our planned shows for January will sure to be very exciting. We are planning to travel to Washington DC to do some shows live in person with the people we are going to interview.

You can find our show on iTunes or you can subscribe to the show with the raw RSS feed.

My plans for now are to do a weekly show as long as I can sustain them throughout 2010.

Coming up in 2010

I don't have many plans for 2010 at this point but there are a few things I am planning on.

We are currently in the middle of planning something huge for jQuery this month.  I'll be travelling with Elijah to cover the "something huge" for the Official jQuery Podcast.

In addition, there will be physical conferences in San Francisco, London and Boston.  I am hoping to at least attend the conferences that won't require a passport.
I am currently scheduled to give a talk on jQuery at LUGOR (Linux User Group of Rochester) on May 20th at RIT.

So there you go you should now be sufficiently "up-to-speed."

Sunday, October 25, 2009

My trip to Toronto and Stack Overflow DevDays 2009

On Wednesday, October 21st, 2009 I took the Amtrak train from Niagara Falls, NY to Toronto, Ontario, Canada.  I was going to speak at Stack Overflow DevDays in Toronto on Friday October 23rd.

I got there an extra day earlier then needed because of the time the train was going to get in on Thursday night I would of missed the speakers dinner.  But this extra time worked to my favor as I needed the extra time to work on finishing my slides and example code I was going to demo.  But I really wanted to go to the NHL Hall of Fame since it was only a block away and I had the chance to take my picture with Lord Stanley's cup.



I spent the afternoon finishing up my slides and I ran through the presentation to make sure the timing was right.  I was able to go through everything I wanted in 50 minutes. 

That evening was the speakers dinner.  I was looking forward to the dinner cause this would of been my first opportunity to meet Joel Spolsky.  But I this was not to be.  Why? Cause Joel forgot his passport and had to fly to NYC to pick it up.  I did however meet all the speakers and four developers from FogCreek Software.  One of which I learned was the intern (that is now working fulltime) who worked on StackExchange.com (the paid hosting version of Stack Overflow).  We spent a couple of hours geeking out telling stories.  The best story was of the assless chaps but I'll let Joey deVilla tell you that story.



So Friday came along and I was really nervous in the morning.  Joel gave his keynote and as I sat through a couple more talks I was starting to relax.  After lunch was my talk.



I've got to say Carsonified really made me comfortable before the talk.  They set up my laptop and made sure it worked on the projector system.  They even loaned me a Logitech slide switcher with a laser pointer.  This made it so that I could walk away from my laptop and walk around the stage.  I felt really comfortable after just a few minutes.  I got a couple of laughs where I was expecting laughs in my slides.  The 32" Viewsonic in the middle of the stage was great for letting me see my slides without being next to my laptop.  It really made it much easier to talk. 

In comparing this talk with my jQuery Conference talk I felt I did 200% better.  I didn't read from my slides like I did in Boston.  Everything flowed right out of me.  Now that's not to say that I did a perfect job cause there was plenty of room for improvement.



I've been monitoring the reviews on twitter and the blogs and I finding people either really got a lot out of the talk or they picked up one or two things.  I've only seen a couple of constructive criticism points for my talk.  The point is that I felt I learned a lot from my jQuery Conference talk and I applied it to this talk and I think the results really show.

After the conference I was able to take a picture with Joel Spolsky.



I also took a photo with fellow speakers Joey deVilla (right) from Microsoft and Reginald Braithwaite (left).



After the conference the speakers, Joel, some attendees and I went to a local bar C'est What? to have a drink and we had great conversations about technology.  I had the chance to talk with Joel one-on-one and got some advice on how to record podcasts, told him I'd love to hear more Israeli Army stories on the podcast and told about how I would love to know what question or answer a badge was referring to when I receive it in Stack Overflow.

I had an amazing time in Toronto and meet some great developers.

The Official jQuery Podcast

with Ralph Whitbeck & Elijah Manor

You can subscribe to the show in iTunes or via the raw RSS feed

My Twitter Updates

View Twitter Page