jQuery

Been Awhile

Published by Cory on Wednesday, November 11, 2009

Well, as many have probably noticed I haven't written anything in awhile. I've had a lot going on with my wife and 11 month old son and started school in August. I also recently had an operation which put me on the shelf for the last few weeks.

There is some good news though. My jQuery work has continued and so has my knowledge of the library. I have a backlog of several new tutorials I'd like to write which I hope to get to in the coming month(s). Then again the holidays are coming up, but I have some vacation time which I hope to use "wisely".

jQuery Accordion Made Easy

Published by Cory on Friday, August 21, 2009

Having recently adding jQuery to my arsenal of web tools I've been experimenting with new ways of organizing content. While tabs is one obvious way of doing this (tutorial to come), my newly preferred method is the Accordion widget in jQuery UI.

It offers a nice flexible options and can be used for nearly all types of content. And the best part of this particular option has to do with the fact that the required code is very minimal and straightforward. Enjoy!

download source filesview demo

Use of jQuery noConflict();

Published by Cory on Monday, August 17, 2009

In my short time of using jQuery I've come across the invaluable method of noConflict(). Why is it so handy? Well, in the world of web design and development, there are lots of very useful JavaScript libraries out there (i.e. YUI, MooTools, Prototype) and several of them use "$" to represent an object. If you are using this syntax within jQuery and another conflicting library simultaneously, you are likely going to run into some unexpected behavior.

Luckily noConflict() is very simple to use and you won't have to go swapping out all your "$" with "jQuery". And to keep it simplistic I'll use the following code to show you how to implement it.

$(function() {
  $("#foo").click(
    // your code here
  )
 
  // any additional code
});

Still using $(document).ready in your jQuery scripts?

Published by Cory on Monday, August 17, 2009

With the amount of jQuery tutorials being written, tweeted, and retweeted I keep seeing one common theme in nearly all of them. None of them use the jQuery shorthand to launch their scripts when their DOM is loaded.

Of course there's nothing wrong with this and it is perfectly valid, but if you are able to cut out code, that means you cut down on development. If you are familiar with jQuery then you're most likely familiar with starting your scripts like so:

$(document).ready(function() {
  //your code here
});

jQuery FAQs: Scroll To and Highlight Tutorial

Published by Cory on Thursday, July 30, 2009

Yesterday I set out with the goal of creating some Frequently Asked Questions (FAQs), with the idea of using jQuery to provide some added functionality. That's when I stumbled across the Bit Repository. They provided a very nice way of accomplishing what I wanted, so I decided to follow their tutorial.

It gave me great inspiration and while implementing the idea, I decided to go ahead and improve upon what they had done. My solution had to be developed so it could easily be reused without having to touch any of the script's again. The following steps outline the approach I took and the accompanying results. Enjoy!

download source filesview demo

Syndicate content