My blog has moved
Please update your bookmarks and feeds for my site.
I now have a Mango Blog at:
http://www.andyjarrett.com/blog
Feed URL: http://feeds.feedburner.com/andyjarrett
Please update your bookmarks and feeds for my site.
I now have a Mango Blog at:
http://www.andyjarrett.com/blog
Feed URL: http://feeds.feedburner.com/andyjarrett
I've been using jQuery for a while now keep meaning to blog about the little bits I use often. One is creating a DIV object on the fly and loading content in to it.
Instead of having "Loading...." being displayed you can delay showing the content of the DIV until loading is completed.
Both sets of code will load on document ready. Usually I tie this kind of process to a click event to load in a page dynamically when needed.
Also don't forget you can chain these methods too and cut down on code. Taking the first example it could be written as:
I've seen some code out there for this, but I've not managed to Google anything I like. My version uses HTML's Definition Lists. <DL>, <DT> and <DD>. Click on one of the questions below to see it in action.
N.B. Thanks to Peter Boughton's comment. Though I try using next() and it wasn't working for me, hence the ID hack I did have. Anyway, thanks Pete.
Here's the code. I've put remarks in the comments on how it works
I've started playing around with jQuery along with the rest of the world it seems and all I can say is WOW. Working with it has been straight forwards and simple.
There's a couple of things out of the box that I like about it, but mainly the fact it comes as one .js file so doesn't matter what affect you want its there. In regards to it's simplness here some quick examples to get going: