Archive

Archive for the ‘Javascript’ Category

Custom Events in jQuery

May 7th, 2009

Events seem daunting at first, but really jQuery makes them super simple. Events can be used to alter behavior or even have multiple events happen on a single state change.

We all know about events like click, onkeydown, onmousedown, onmouseover, etc. But you can fire custom events as well. First you need to understand how to fire events. You can do this by using the $().trigger() event through jQuery.
Read more…

Author: jcfant Categories: Javascript, jQuery Tags: , ,

Using callbacks from plugins and other javascript objects.

May 7th, 2009

Now that we’ve seen how to implement callbacks from our plugins, lets take a look at what we can do with them. I previously touched on the jQuery Plugin Development pattern subject and built a quick tabs plugin that featured callbacks (you can see a demo here), now lets start taking advantage of them. Read more…

Author: jcfant Categories: Javascript, jQuery Tags: ,

Expanding the jQuery Plugin Development Pattern

May 1st, 2009

Recently I was tasked with writing a jQuery plugin for a carousel. I am sure at this point you are asking yourself, “Why would you write another one when there are so many out there?”. I agree. However, while there are alot of very good carousel plugins, the requirements meant that I would end up having to edit the code anywyas. And, since this would be my first shot at writing a jQuery plugin from scratch and I figured it would be a good time to learn the process and to document some best practices/design patterns.
Read more…

Author: jcfant Categories: Javascript, jQuery Tags: , ,