What, who, where am I?!?
Craig Lotter is a web developer based in Gordon's Bay, South Africa, who seems completely incapable of shaking off that pesky inner child within, the one that forces him to love all things animated or hand drawn.
The Rugged Rock of Craig contains snippets of his life, popular culture and all the important things like anime, manga, games and comic books. The CodeUnit of Craig on the other hand contains the more serious stuff like code snippets and tutorials, while the House of C chronicles his foray into the world of web comics.
For which it never seems he has enough time anyway.
CodeUnit Post Archive
Rugged Rock Studio
Tag Archives: jQuery
jQuery: Iterate Through an Element’s Classes
More often than not, your HTML elements will have more than one class assigned to them. Now while it is easy to check if an element belongs to a certain class with jQuery’s built in hasClass function, you’ll be pleased to know it is just as easy to iterate through all of an element’s classes with some basic loop work.
Continue reading
jQuery UI: Remember Your Open Tab
The jQuery UI library is a brilliant collection of official jQuery UI widgets and effects, one of them being the extremely useful Tabs widget.
Tabs allows you to shorten a page by placing bits of a page’s content into their own little “tabs”, which can be access by clicking on the tab header. A brilliant space saving mechanism and one that has become quite commonplace in applications these days.
Sometimes it is nice to remember what tab you currently have open so that when you travel to some other part of a site and then return to your original page, you want it to remember which tab you had currently selected. Continue reading
Posted in Technology & Code, Tutorials
Tagged javascript, jQuery, jquery ui, memory, open tab, tabs
Leave a comment
jQuery: Invert a Selection of Checked Checkboxes

If you have a group of checkboxes on a page, sometimes it is quite nice to give the user some quickfire controls that allows him to select all or select none at a click of a button. Similarly, it is pretty cool to give him the option of inverting his current selection, in other words checking all of those checkboxes currently unchecked, while unchecking all the currently ticked checkboxes. Continue reading
jQuery: Count the Number of Checkboxes Checked on a Page

To return the number of checked or ticked checkboxes on a page using jQuery is in actual fact pretty simple. By making use of the special :checked selector and combining it with the standard length property. Continue reading






