Pajama Sloth

because sloths can wear them too

June 18, 2012 at 11:55am

2 notes

jQuery Picture →

An excellent way for serving up different images based on media queries. This is an approach that may one day become a standard but for now this jQuery plugin will serve to ease the transition.

May 17, 2012 at 5:43pm

0 notes

Build your own super simple jQuery slideshow →

Too many times have I needed a really barebones slideshow for a project. I finally decided just to build a really basic one that I could use as a starting point from now on. Obviously you might just download a slideshow plugin (or something) if you want some more functionality but for some this may be an elegant solution so I thought I’d share.

November 23, 2011 at 8:56am

5 notes

jQuery Theme Roller Released! →

I might be a little tardy to this party.

October 11, 2011 at 12:00pm

0 notes
Themeroller for jQuery Mobile coming soon! Their blog says within the next week or two…

Themeroller for jQuery Mobile coming soon! Their blog says within the next week or two…

September 7, 2011 at 2:54pm

6 notes

jQuery 1.4.4 Animate Bug (+-10,000) →

Just spent a good amount of time trying to figure out why one of my custom sliders was broken. Turns out it has to do with what seems to be a fairly arbitrary value of 10,000. Essentially, if you are trying to move an object by more than plus or minus 10,000 pixels the slider breaks. Anyway, the answer can be found in this link. Just change one line of jQuery core and your problems will go away. *Frustrated*.

July 5, 2011 at 5:41pm

7 notes

jQTouch Tutorial →

jQTouch is a jQuery plugin that can make mobile site development a whole lot easier. There’s one problem though - finding good documentation. Follow along with this tutorial and you’ll get a pretty good idea of what jQTouch can do for you.

June 3, 2011 at 5:44pm

0 notes

Facebook Hub v.2

An update has been made to the Facebook Hub - one button that consolidates the Like Button, Send Button and Facebook Share into one handy little hub.

Facebook Hub Screenshot

What’s new in version 2?

New options:

  • Recommend button support
  • Ability to turn off any button
  • Dark color palette for like button
  • Ability to have overlay appear beneath main button rather than above.

Demo

Download Code w/ Documentation Here

May 24, 2011 at 5:29pm

7 notes

jQuery Loader Image or Text for AJAX

While waiting for an AJAX request it can sometimes be helpful to include a spinner or simply some text that says ‘Loading…’. This serves to relax the mouse finger of the more jumpy visitor who may suspect a bug and leave your site before some content has finished loading.

First, setup a div or some element that will house the content that you will be pulling in: <div id=”container”></div>

Second, put inside of that container your spinner or text. For this example I will use text: <div id=”container”><span class=”loading”>Loading…</span></div>

This will create an element with the phrase “Loading…” inside.

The next step is to pull in some content using $.get.

$.get('your_file.php', function(data){$("#container").html(data);})

This should work to get the content and put it inside of the container but what about getting rid of the loading message? To do this remove the loading element right before you bring in the content.

$.get('your_file.php', function(data){
	// Remove Loading
	$('.loading').remove();
	// Load data into container
	$("#container").html(data);
})

May 3, 2011 at 1:05am

1 note

Facebook Hub - A jQuery Plugin

UPDATE: Facebook Hub is now in version 2. Click here.

Version 1 of Facebook Hub has just officially launched. Facebook hub is a jQuery plugin that combines all the crazy Facebook buttons (like, share, and  send) into one simply designed hub.

To use, make sure you include the Facebook Connect in the <head> of your document.  Just include a script tag with ‘http://connect.facebook.net/en_US/all.js#xfbml=1’ as the source.

Then simply call fbHub() on any element that you would like to use as a container for your Facebook hub.

$('.myElement').fbHub();

Facebook hub currently allows for only a few options but I hope there will be more in the near future.

$('.myElement').fbHub({
  url: 'http://your_url.com', // This connects the Facebook buttons to the right place
  name: 'Custom Name', // the default name for the hub is 'hub' but you can change it by specifying this
  hide: false // the default value for this option is true.  Setting this to false makes it so that the hub starts off open.
})

Here is a demo

Download the hub here

This is definitely a work in progress so your feedback is greatly appreciated

April 22, 2011 at 5:48pm

0 notes

Display jQuery UI Icons Inline →

To get jQuery UI icons inline alongside your text simply just add this line of CSS to your master stylesheet.

.ui-icon { display: inline-block !important }

Update:

The code above is only necessary if you do not choose to download the jQuery UI Button package, which includes a button stylesheet