Skip directly to content

code

jQuery/CSS Expandable Content

on Fri, 08/12/2011 - 17:45

For a mockup I worked on this week, the client requested a list of 10 essential resources to be included at the top of the content sidebar.  Unfortunately, displaying all 10 tended to push down the other sidebar content so far that they fell far below the fold.  I came up with this quick jQuery/CSS solution to make elegant expandable content divs.

Here's what it looks like:

When you click the 'See More...' link, the div expands to reveal all the content.

Here's the jQuery:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="

jQuery Suckerfish Menu Replacement

on Wed, 08/10/2011 - 19:36

Back in the day, Suckerfish was the go-to CSS solution for drop-down navigation menus.  I'm thrilled that nowadays, we can accomplish basically the same thing with a dash of jQuery and far less code.  I recently whipped up one for a mockup.  Here's the HTML/Javascript I used:

jQuery: Flickr Photo of the Day

on Thu, 08/04/2011 - 14:46

For our upcoming State Fair coverage, we're going to be featuring a user-submitted photo of the day. We're taking submissions via a Flickr group/pool we've maintained for the last several years. I was looking for a solution that would require minimal maintenance on our end: preferably one that can be managed entirely through Flickr, but if that wasn't going to be feasible, I'd settle for the simplest manual process possible.

The following jQuery script covers both possibilities.

jQuery JSON-powered Widget - Display 20 Latest Videos

on Fri, 07/29/2011 - 23:17

A few months ago, I created an embeddable widget that displayed the last 20 videos for one of our locally produced shows, Iowa Outdoors:

Originally, I designed it to run off the same RSS feeds we publish for syndication purposes.  The widget was designed to be an all-purpose container that used jQuery to fetch the RSS feed, convert it to JSON, then iterate over the results to spit out links, thumbnails and descriptions.

There were several RSS-specific challenges that this version presented, including converting a duration in seconds to standard hh:mm:ss notation and the ever-present date

T-SQL: Remove line breaks from data

on Thu, 07/28/2011 - 15:39

This came in handy yesterday, when a co-worker wanted to remove line breaks from data she was exporting from Microsoft SQL Server:

UPDATE table_name SET 
field_name = REPLACE(field_name, '
', '');
UPDATE table_name SET 
field_name = REPLACE(field_name, CHAR(13), '');
UPDATE table_name SET 
field_name = REPLACE(field_name, CHAR(10), '');

 

Pages