Taking Online Video to New Heights

Musings, ramblings and observations regarding video on the web

Mediascend's Weblog – Musings, ramblings and observations regarding video on the web

Archive for the ‘jQuery’ Category

Future of Web Apps Miami 2010 Highlights

Friday, March 12th, 2010

We volunteered to shoot and produce footage for 2010 Future of Web Apps (FOWA) in Miami.  Carsonified did a great job putting on the event.  There were some serious heavy hitters – Alex Payne, Fred Wilson, Gary Vaynerchuk, John Resig, Molly Holzschlag, Steve Huffman, Tara Hunt, and plenty others.  We put together this highlight piece that pretty much sums up the event.  We had a blast and we’re looking forward to the next one.

Future of Web Apps – Miami 2010 (FOWA)

Tuesday, February 16th, 2010

We’re super-excited to announce we’ll be covering the Future of Web Apps – Miami 2010 (FOWA) on the February 22nd-24th.

Like previous years, this year’s line up is incredible with speakers like Alex Payne, Fred Wilson, Gary Vaynerchuk, John Resig, Molly Holzschlag, Steve Huffman and Tara Hunt from companies including Twitter, Reddit, Mint.com, jQuery, Palm Pre, FreshBooks, Opera and PayPal.

If you’re in technology and have the means to make it down you owe it to yourself to attend.

And if you see 2 dorks with HD video cameras and boom mics, feel free to say hi.

More info here: (http://events.carsonified.com/fowa/2010/miami)

jQuery 1.4.1 Released

Tuesday, January 26th, 2010

From the blog:

jQuery 1.4.1 is now out! This is the first bug fix release on top of jQuery 1.4, fixing some outstanding bugs from the 1.4 release and touching up some gaps in the API.

Download jQuery 1.4.1 now if you’re currently using 1.4.0.

jQuery .removeClass() and the Mysterious Extra Space

Friday, January 22nd, 2010

Recently I needed to execute a set of tabs based on an unordered list (ul). Being tabs, they’d need (at the minimum) an off and on state.

As I mentioned, the markup for this tabbed set would be an unordered list:

Markup

This post will mainly cover behavior. There are many great tutorials on how to style a tabbed system using the sliding doors technique. I suggest A List Apart’s excellent post: http://www.alistapart.com/articles/slidingdoors2/.

Anyhoo, the logic for this is fairly simple. On page load the first tab (li) would have a class of “current”. On click of any of the tabs, remove the class from all tabs, then apply class=”current” to the item being clicked (this).

So far so good. Now to prevent multiple clicks on the same tab, we’ll need to add a conditional statement (if) to only execute the logic if the tab being clicked is not the currently-selected tab.

So simply ensure that the currently-clicked tab’s class is NOT “current”. Easy, right?

Not so much. Being me and having my luck, it didn’t work right out of the box.

The issue stemmed from my use of jQuery .addClass() and .removeClass() to inject the “current” class onto and from the appropriate tabs. For reasons I don’t understand, .removeClass() does indeed remove the class, but it also leaves behind a space (class=” “).

So as you can imagine this unexpected behavior could be an if-statement-buster if you’re not careful, as I wasn’t.

The way around it is simply to use jQuery’s .attr() method and manually set and remove the class attribute value. ($(this.attr(“class”,”current”);). This way you know exactly what values are potentially injected and can prepare you conditional statements accordingly.

Code

So, does anyone know why .removeClass() leaves a space?

  • Archives

  • Pages

  • Categories

Mediascend's Weblog – Musings, ramblings and observations regarding video on the web is proudly powered by WordPress 3.0 Entries (RSS) Comments (RSS).