<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MoonKat Creations &#187; jQuery</title>
	<atom:link href="http://www.moonkatcreations.com/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.moonkatcreations.com</link>
	<description>Web design, front-end development</description>
	<lastBuildDate>Thu, 12 May 2011 18:52:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Easy Hover or Tooltip Script</title>
		<link>http://www.moonkatcreations.com/web-design/jquery/easy-hover-or-tooltip-script/</link>
		<comments>http://www.moonkatcreations.com/web-design/jquery/easy-hover-or-tooltip-script/#comments</comments>
		<pubDate>Thu, 05 May 2011 21:32:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=479</guid>
		<description><![CDATA[Use this when you want a tooltip-like effect when one of a group of many elements is hovered over. You will also need a .png or a .gif for the background of the tooltip. Or, you could just be creative &#8230; <a href="http://www.moonkatcreations.com/web-design/jquery/easy-hover-or-tooltip-script/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Use this when you want a tooltip-like effect when one of a group of many elements is hovered over. You will also need a .png or a .gif for the background of the tooltip. Or, you could just be creative with your CSS.</p>
<pre>jQuery(".hoverElement").hover(function(b) {
    var offsetLeft = jQuery(this).offset().left;
    var offsetTop = jQuery(this).offset().top;
    jQuery("div#" + jQuery(this).attr("rel")).show("fast").offset({
        top: offsetTop - 18,
        left: offsetLeft + 15
    });
}, function() {
    jQuery("div#" + jQuery(this).attr("rel")).hide("fast")
    });
</pre>
<p>If you have multiple elements that require the effect, give them all the same class. For each hover element, you will need a hidden element with a unique id that contains the tooltip content. In the &#8220;rel&#8221; tag of each hover element, put the id of the corresponding hidden element, minus the &#8220;#&#8221;. This can probably be condensed to use only one hidden element, but I haven&#8217;t gotten around to simplifying yet.</p>
<p>Adjust the offset as needed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/web-design/jquery/easy-hover-or-tooltip-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS style reset</title>
		<link>http://www.moonkatcreations.com/misc/css-style-reset/</link>
		<comments>http://www.moonkatcreations.com/misc/css-style-reset/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 17:38:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=410</guid>
		<description><![CDATA[One of the best and most common CSS style resets from Eric Meyer. <a href="http://www.moonkatcreations.com/misc/css-style-reset/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is a good one from <a href="http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/">Eric Meyer</a>:</p>
<p><code><br />
html, body, div, span, applet, object, iframe,<br />
h1, h2, h3, h4, h5, h6, p, blockquote, pre,<br />
a, abbr, acronym, address, big, cite, code,<br />
del, dfn, em, font, img, ins, kbd, q, s, samp,<br />
small, strike, strong, sub, sup, tt, var,<br />
dl, dt, dd, ol, ul, li,<br />
fieldset, form, label, legend,<br />
table, caption, tbody, tfoot, thead, tr, th, td {<br />
	margin: 0;<br />
	padding: 0;<br />
	border: 0;<br />
	outline: 0;<br />
	font-weight: inherit;<br />
	font-style: inherit;<br />
	font-size: 100%;<br />
	font-family: inherit;<br />
	vertical-align: baseline;<br />
}<br />
/* remember to define focus styles! */<br />
:focus {<br />
	outline: 0;<br />
}<br />
body {<br />
	line-height: 1;<br />
	color: black;<br />
	background: white;<br />
}<br />
ol, ul {<br />
	list-style: none;<br />
}<br />
/* tables still need 'cellspacing="0"' in the markup */<br />
table {<br />
	border-collapse: separate;<br />
	border-spacing: 0;<br />
}<br />
caption, th, td {<br />
	text-align: left;<br />
	font-weight: normal;<br />
}<br />
blockquote:before, blockquote:after,<br />
q:before, q:after {<br />
	content: "";<br />
}<br />
blockquote, q {<br />
	quotes: "" "";<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/misc/css-style-reset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Search for URL String with jQuery</title>
		<link>http://www.moonkatcreations.com/web-design/jquery/search-for-url-string-with-jquery/</link>
		<comments>http://www.moonkatcreations.com/web-design/jquery/search-for-url-string-with-jquery/#comments</comments>
		<pubDate>Mon, 13 Sep 2010 16:24:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=399</guid>
		<description><![CDATA[A time may arise when you need to assign a different body class to each unique page, or run some function based on the current page. <a href="http://www.moonkatcreations.com/web-design/jquery/search-for-url-string-with-jquery/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A time may arise when you need to assign a different body class to each unique page, or run some function based on the current page. If you do not have access to the source code or some other shortcut to determine page name, sometimes the easiest way to determine the current page is to parse through the URL. There&#8217;s an easy way to do it in jQuery, based on this <a href="http://www.webmaster-talk.com/javascript-forum/179127-if-the-url-contains-something-do.html">thread</a>.</p>
<p>The poster was very close to a functional script. If you add in &gt; -1 into the first part of the &#8216;if&#8217; statement, it works like a charm.</p>
<p><code>jQuery(function() {<br />
var url = location.pathname;<br />
if(url.indexOf('web-design') &gt; -1) {<br />
jQuery("#web_design").addClass("active");<br />
}<br />
if(url.indexOf('french') &gt; -1) {<br />
jQuery("#french").addClass("active");<br />
}<br />
if(url.indexOf('my-take') &gt; -1) {<br />
jQuery("#my_take").addClass("active");<br />
}<br />
if(url.indexOf('portfolio') &gt; -1) {<br />
jQuery("#portfolio").addClass("active");<br />
}<br />
});</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/web-design/jquery/search-for-url-string-with-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Finding the Date With jQuery</title>
		<link>http://www.moonkatcreations.com/web-design/jquery/finding-date-with-jquery/</link>
		<comments>http://www.moonkatcreations.com/web-design/jquery/finding-date-with-jquery/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 23:03:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=282</guid>
		<description><![CDATA[Based on this post, http://arnelbornales.wordpress.com/2009/02/25/get-the-current-date-using-jquery/, this is a simple script for finding the date <a href="http://www.moonkatcreations.com/web-design/jquery/finding-date-with-jquery/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Based on this post (<a href="http://arnelbornales.wordpress.com/2009/02/25/get-the-current-date-using-jquery/">http://arnelbornales.wordpress.com/2009/02/25/get-the-current-date-using-jquery/</a>) here is a simple script for finding the date:</p>
<p><code><script type="text/javascript">// <![CDATA[
  var m_names = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); var d = new Date(); var curr_date = d.getDate(); var curr_month = d.getMonth(); var curr_year = d.getFullYear(); document.write(curr_date + "-" + m_names[curr_month] + "-" + curr_year); /* The last two lines above have to placed on a single line */
// ]]&gt;</script></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/web-design/jquery/finding-date-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery.event Is Not a Function Error</title>
		<link>http://www.moonkatcreations.com/web-design/jquery/jquery-event-is-not-a-function-error/</link>
		<comments>http://www.moonkatcreations.com/web-design/jquery/jquery-event-is-not-a-function-error/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 18:31:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery tools]]></category>
		<category><![CDATA[scrollable]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=316</guid>
		<description><![CDATA[An out-of-date jQuery file could be causing all kinds of mysterious errors, so make sure you have the latest version  <a href="http://www.moonkatcreations.com/web-design/jquery/jquery-event-is-not-a-function-error/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently, while implementing <a href="http://flowplayer.org/tools/demos/scrollable/index.html">jQuery Tools&#8217;s scrollable</a>, I came across a &#8220;jquery.event is not a function&#8221; error. I used the un-minified versions of the scrollable jQuery along with its plugins, autoscroll and navigator, in order to troubleshoot, but no matter what I tried, I kept getting this same error. Finally I read on a <a href="http://drupal.org/node/638252" target="_blank">drupal forum</a> that this error could be caused by an outdated version of jQuery.js. I updated that file, and the error vanished.</p>
<p>The moral of the story: this out of date file could be causing all kinds of mysterious errors, so make sure you have the latest version of jQuery before spending hours troubleshooting all the other files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/web-design/jquery/jquery-event-is-not-a-function-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy jQuery Form Validation</title>
		<link>http://www.moonkatcreations.com/web-design/jquery/easy-jquery-form-validation/</link>
		<comments>http://www.moonkatcreations.com/web-design/jquery/easy-jquery-form-validation/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 21:40:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=300</guid>
		<description><![CDATA[This is hands-down the easiest jQuery form validation that's out there—that I've found in my hours of searching anyway. <a href="http://www.moonkatcreations.com/web-design/jquery/easy-jquery-form-validation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is hands-down the easiest jQuery form validation that&#8217;s out there—that I&#8217;ve found anyway.<br />
<code><br />
$('form.validate').submit(function() {<br />
$(this).find('div span').remove();<br />
$(this).find('span.error-message').hide();</code></p>
<p>var valid = true;<br />
$(this).find(&#8216;.req&#8217;).each(function() {<br />
if ($(this).val() == &#8220;&#8221;) {<br />
$(this).after(&#8216;&lt;span&gt;Required!&lt;/span&gt;&#8217;);<br />
valid = false;<br />
} else if ($(this).hasClass(&#8216;req-email&#8217;) &amp;&amp; !checkemail($(this).val())) {<br />
$(this).after(&#8216;&lt;span&gt;Invalid E-mail!&lt;/span&gt;&#8217;);<br />
valid = false;<br />
} else if ($(this).hasClass(&#8216;req-phone&#8217;) &amp;&amp; checkphone($(this).val())) {<br />
$(this).after(&#8216;&lt;span&gt;Numbers Only!&lt;/span&gt;&#8217;);<br />
valid = false;<br />
}<br />
});<br />
if (!valid) {<br />
$(this).find(&#8216;span.error-message&#8217;).text(&#8220;Please correct the above errors.&#8221;).show();<br />
return false;<br />
}<br />
});<br />
function checkemail(e){<br />
var emailfilter = /^w+[+.w-]*@([w-]+.)*w+[w-]*.([a-z]{2,4}|d+)$/i<br />
return emailfilter.test(e);<br />
}<br />
function checkphone(e) {<br />
var filter = /[0-9]/<br />
return filter.test(e);<br />
}</p>
<p>Found here: <a href="http://www.aarongloege.com/blog/web-development/javascript/jquery/easy-form-validation/">http://www.aarongloege.com/blog/web-development/javascript/jquery/easy-form-validation/</a></p>
<p>What makes it even better is that it&#8217;s highly customizable. I used Aaron&#8217;s structure to write my own custom validation. I&#8217;ve shared here the additional/modified filters.</p>
<p><code>function checkemail(e){<br />
var emailfilter = /^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/<br />
return emailfilter.test(e);<br />
}<br />
function checkphone(e) {<br />
var filter = /[0-9]{10}/<br />
return filter.test(e);<br />
}<br />
function checkzip(e){<br />
var zipfilter = /[0-9]{5}/<br />
return zipfilter.test(e);<br />
}<br />
function checkpassword(e) {<br />
var passwordfilter = /^.{6,50}$/<br />
return passwordfilter.test(e);<br />
}<br />
function checkcreditcard(e) {<br />
var creditcardfilter = /[0-9]{15,16}/<br />
return creditcardfilter.test(e);<br />
}</code></p>
<p>You can write as many of these as you want. Additionally, though he has his error messages writing to a span, you can insert whatever kind of action you want to happen inside the if/else statements.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/web-design/jquery/easy-jquery-form-validation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forward/Next Script for jQuery Tools Tabs</title>
		<link>http://www.moonkatcreations.com/web-design/jquery/forwardnext-script-for-jquery-tools-tabs/</link>
		<comments>http://www.moonkatcreations.com/web-design/jquery/forwardnext-script-for-jquery-tools-tabs/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 21:07:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=292</guid>
		<description><![CDATA[Make forward and next buttons or links on each tab view. In the rel tags of each button, place the id of the tab that would be next or before in the sequence. <a href="http://www.moonkatcreations.com/web-design/jquery/forwardnext-script-for-jquery-tools-tabs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Make forward and next buttons or links on each tab view. In the rel tags of each button, place the id of the tab that would be next or before in the sequence.</p>
<p><code>&lt;button rel="#tab1"&gt;&amp;nbsp;&lt;/button&gt;<br />
&lt;button rel="#tab3"&gt;&amp;nbsp;&lt;/button&gt;</code></p>
<p>Then, use this handy little script:</p>
<p><code>$('.nav_arrow').click(function () {<br />
var nextPage = $(this).attr('rel');<br />
$(nextPage).click();<br />
return false;<br />
});</code></p>
<p>Effectively, you are telling the forward or next button that if it&#8217;s clicked, cause the corresponding tab to be clicked, opening that view.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/web-design/jquery/forwardnext-script-for-jquery-tools-tabs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Clearfields Plugin</title>
		<link>http://www.moonkatcreations.com/web-design/jquery/jquery-clearfields-plugin/</link>
		<comments>http://www.moonkatcreations.com/web-design/jquery/jquery-clearfields-plugin/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 20:06:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=286</guid>
		<description><![CDATA[It's easy to implement. Download clearfield.js and link it into your page. Then place the class "clearField" on all your inputs, selects, and textareas. Instantiate the function in your custom javascript page with this: <a href="http://www.moonkatcreations.com/web-design/jquery/jquery-clearfields-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is not the one mentioned on jQuery.com (<a href="http://plugins.jquery.com/project/clearField)">http://plugins.jquery.com/project/clearField)</a>. However, this may have been inspired by it. I can&#8217;t remember where this plugin came from, to be totally honest. It was possibly written by my ex-coworker Nathan. Any-who, if the author steps forward, I will be glad to attribute it.</p>
<p>It&#8217;s easy to implement. Download <a title="Go to clearfield.js" href="http://docs.google.com/leaf?id=0B4rh0uE53CoyYTRlODRhNzEtMjkxMC00NTA1LTlkYzMtNGZhYzA2NDNlZWFm&amp;hl=en&amp;authkey=CKPF1Bg" target="_blank">clearfield.js</a> and link it into your page. Then place the class &#8220;clearField&#8221; on all your inputs, selects, and textareas. Instantiate the function in your custom javascript page with this:</p>
<p><code>$('.clearField').clearField();</code></p>
<p>If you don&#8217;t have access to the form element markup, or you are using a framework, a little bit of jQuery can be used to add the necessary classes:</p>
<p><code>$('input, select').addClass('clearField');</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/web-design/jquery/jquery-clearfields-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Striping for Table Rows</title>
		<link>http://www.moonkatcreations.com/web-design/jquery/jquery-striping-for-table-rows/</link>
		<comments>http://www.moonkatcreations.com/web-design/jquery/jquery-striping-for-table-rows/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 20:05:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=279</guid>
		<description><![CDATA[A simple script to select, and then add striping to table rows: $(&#8216;tr:odd td&#8217;).css(&#8216;background&#8217;,'#yourcolor&#8217;);]]></description>
			<content:encoded><![CDATA[<p>A simple script to select, and then add striping to table rows:</p>
<p>$(&#8216;tr:odd td&#8217;).css(&#8216;background&#8217;,'#yourcolor&#8217;);</p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/web-design/jquery/jquery-striping-for-table-rows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy Textarea Maxlength Script</title>
		<link>http://www.moonkatcreations.com/web-design/jquery/easy-textarea-maxlength-script/</link>
		<comments>http://www.moonkatcreations.com/web-design/jquery/easy-textarea-maxlength-script/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 18:39:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=268</guid>
		<description><![CDATA[This is a very simple maxlength script, quickly and easily implemented. <a href="http://www.moonkatcreations.com/web-design/jquery/easy-textarea-maxlength-script/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is a very simple maxlength script, quickly and easily implemented. The original is found at <a title="Link to Dynamic Drive Textarea Maxlength Script" href="http://www.dynamicdrive.com/dynamicindex16/maxlength.htm" target="_blank">http://www.dynamicdrive.com/dynamicindex16/maxlength.htm</a></p>
<p><code><br />
/***********************************************<br />
* Textarea Maxlength script- © Dynamic Drive (www.dynamicdrive.com)<br />
* This notice must stay intact for legal use.<br />
* Visit http://www.dynamicdrive.com/ for full source code<br />
***********************************************/</p>
<p>function ismaxlength(obj){<br />
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""<br />
if (obj.getAttribute &amp;&amp; obj.value.length&gt;mlength)<br />
obj.value=obj.value.substring(0,mlength)<br />
}</code></p>
<p>Update: Here is one that includes a remaining characters counter:<br />
<a href="http://www.mediacollege.com/internet/javascript/form/limit-characters.html">http://www.mediacollege.com/internet/javascript/form/limit-characters.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/web-design/jquery/easy-textarea-maxlength-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

