Part 2 of Rapid Template Development with Joomla! 1.5, YUI CSS & jQuery that i presented at CMSexpo in Denver, Colorado.
The Morph framework and toolset for Joomla is now available for purchase and use - read more at http://www.joomlajunkie.com/templates/morph/morph.html
1. Rapid Template Development
with Joomla, YUI & jQuery
Chris Rault, Web Monkeys
CMSExpo, Denver Colorado - December 08
http://joomlajunkie.com http://prothemer.com http://cmsexpo.net
2. jquery examples
Setting jQuery into “no-conflict” mode
var $pt = jQuery.noConflict();
$pt(document).ready(function(){
// CODE HERE
});
});
http://jquery.com
3. jquery examples
Example 1.) Enhance your sidebar menu with simple toggle functions.
$(quot;.menu .parent ulquot;).hide();
$(quot;ul.menu li.parent aquot;).click(function(){
$(this).next().toggle().end();
return false;
});
http://jquery.com
4. jquery examples
Example 2.) Add “first” & “last” classes to sidebar modules.
$(quot;#sidebar .module:firstquot;).addClass(quot;firstquot;);
$(quot;#sidebar .module:lastquot;).addClass(quot;lastquot;);
http://jquery.com
5. jquery examples
Example 3.) Add a class to form input elements based on their type:
$(quot;inputquot;).each(function() {
$(this).addClass($(this).attr(quot;typequot;));
http://jquery.com
6. jquery examples
Example 4.) Remove the last “span.separator”:
$(quot;.inner .article_separator:lastquot;).addClass(quot;lastquot;);
http://jquery.com
7. jquery examples
Example 5.) Zebra striping on table rows (or anything!):
$(quot;table tr:evenquot;).addClass(quot;altquot;);
http://jquery.com
8. jquery examples
Example 6.) Assign images a class based on their alignment:
$('img[align*=right]').addClass(quot;img-rightquot;);
$('img[align*=left]').addClass(quot;img-leftquot;);
http://jquery.com
9. jquery examples
Example 7.) Add a “teaser” class to first paragraphs of an article:
$(quot;#content p:firstquot;).addClass(quot;teaserquot;);
http://jquery.com