<?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>Alexandru Dinulescu&#039;s Thoughts&#187; jQuery</title>
	<atom:link href="http://alexdweb.com/blog/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://alexdweb.com/blog</link>
	<description>This blog is about everything/anything related to XHTML/CSS and of course my favourite js library, jQuery.</description>
	<lastBuildDate>Thu, 09 Dec 2010 12:04:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>jQuery/javascript negation</title>
		<link>http://alexdweb.com/blog/2010/01/25/jqueryjavascript-negation/</link>
		<comments>http://alexdweb.com/blog/2010/01/25/jqueryjavascript-negation/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 16:42:23 +0000</pubDate>
		<dc:creator>Dinulescu Alexandru Adrian</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Nerd Rage]]></category>

		<guid isPermaLink="false">http://alexdweb.com/blog/?p=291</guid>
		<description><![CDATA[JQuery Negation &#160;if&#40;!$&#40;stuff&#41;.length &#62; 5&#41;&#123; &#160; &#160;// If element ISNT LARGER THAN 5 so in our case the number of elements must be 0 1 2 3 4 and 5 &#160; $&#40;this&#41;.doSomething&#40;&#41;; &#125; else &#123; &#160;// The number of elements is GRATER THAN 5 // do another thing &#125; Basically this is a negation of [...]]]></description>
			<content:encoded><![CDATA[<p> JQuery Negation </p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>$<span style="color: #009900;">&#40;</span>stuff<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">5</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #006600; font-style: italic;">// If element ISNT LARGER THAN 5 so in our case the number of elements must be 0 1 2 3 4 and 5 </span><br />
&nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">doSomething</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #006600; font-style: italic;">// The number of elements is GRATER THAN 5 // do another thing </span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p> Basically this is a negation of the following, god damnit my head hurts </p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span>stuff<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">5</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp;$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">doSomething</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">doAnotherThing</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p> Oh well new day, new learned things. God Bless Amerika </p>
]]></content:encoded>
			<wfw:commentRss>http://alexdweb.com/blog/2010/01/25/jqueryjavascript-negation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inanis MOD version 2.0</title>
		<link>http://alexdweb.com/blog/2010/01/09/inanis-mod-version-2-0/</link>
		<comments>http://alexdweb.com/blog/2010/01/09/inanis-mod-version-2-0/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 17:21:39 +0000</pubDate>
		<dc:creator>Dinulescu Alexandru Adrian</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[XHTML/CSS]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS Images]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Wordpress Themes]]></category>

		<guid isPermaLink="false">http://alexdweb.com/blog/?p=268</guid>
		<description><![CDATA[Hello After a week of work, I finished the modifications to the this theme, based on the Inanis Theme MOD. This theme is used on both my blogs and so far it works good. I havent encountered any issues so i decided to release the files. Compared to V1.3 which can be found here, this [...]]]></description>
			<content:encoded><![CDATA[<p> Hello </p>
<p> After a week of work, I finished the modifications to the this theme, based on the Inanis Theme MOD. This theme is used on both my blogs and so far it works good. I havent encountered any issues so i decided to release the files.  Compared to V1.3 which can be found <a href="http://alexdweb.com/blog/2009/12/27/wordpress-inanismod-theme-launch/">here</a>, this version has a shitload of improvements such as: (taken from readme) </p>
<p><span id="more-268"></span></p>
<ul>
<li>Version 2.0
<ul>
<li>a) New Image Preloader Via <acronym title="Cascading Style Sheets">CSS</acronym> 2.0</li>
<li> b) Since dropping support for <acronym title="Internet Explorer">IE</acronym>6, trying to make the most with the newest technologies, added rounded borders for firefox/safari/chrome while keeping the old img based solution for <acronym title="Internet Explorer">IE</acronym>7/8. People using those 3 aforementioned browsers will get a small boost in speed since also the divs that took care of the entire img fest are not loaded anymore. </li>
<li> c) Fixed a small issue with the wp_smilies class + added support for the default wordpress alignleft/aligncenter/alignright classes which didnt existed in the <acronym title="Cascading Style Sheets">CSS</acronym> previous versions </li>
<li> d) For <acronym title="Internet Explorer">IE</acronym>6 added a small download link for newer browsers ( update you bastards ) </li>
<li> e) Small optimization done to the start menu. When you click a new theme it activates the theme and automatically closes the menu behind. </li>
<li> f) Decided to drop all those extra clear divs and started to use the clearfix method, so lots of divs have been sliced and diced. </li>
<li> g) For the index, i modified the file so now the excerpts of the posts will show instead of the full post. The user can access the full post by clicking on the more link. Very easily. </li>
<li> h) More minor fixes for the css so everything fits. </li>
</ul>
</li>
<li>Version 1.4 Image Preloader + NoScript functionality.
<ul>
<li>a) Added an image preloader.</li>
<li>b) Small no script stuff.</li>
<li>c) fixed some footer issues with the links</li>
</ul>
</li>
<li>Version 1.31 Small Bugfix
<ul>
<li>a) Fixed a <acronym title="Cascading Style Sheets">CSS</acronym> issue with pingbacks </li>
</ul>
</li>
</ul>
<p> The files can be found <a href='http://alexdweb.com/blog/wp-content/uploads/2010/01/inanisMod_v2.0.zip'>inanisMod_v2.0</a> also please put the comment-template.php from this zip in the wp-includes folder since the xhtml structure is modified. <a href='http://alexdweb.com/blog/wp-content/uploads/2010/01/comment-template.zip'>comment-template</a></p>
]]></content:encoded>
			<wfw:commentRss>http://alexdweb.com/blog/2010/01/09/inanis-mod-version-2-0/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JQuery IE Document/Window Errors</title>
		<link>http://alexdweb.com/blog/2009/12/28/jquery-ie-documentwindow-errors/</link>
		<comments>http://alexdweb.com/blog/2009/12/28/jquery-ie-documentwindow-errors/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 16:28:19 +0000</pubDate>
		<dc:creator>Dinulescu Alexandru Adrian</dc:creator>
				<category><![CDATA[IE6 Bugs]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[IE Bugs]]></category>
		<category><![CDATA[Nerd Rage]]></category>

		<guid isPermaLink="false">http://alexdweb.com/blog/?p=166</guid>
		<description><![CDATA[Hello After working on the google shortcuts for a while, i decided to open up IE 8 and see if the application works or not. I was surprised and started to do the old alert&#40;&#34;hax&#34;&#41; thing every dozen lines. The problem is with the $&#40;window&#41;.keypress&#40;function&#40;e&#41;&#123;&#125;&#41;. It seems that IE doesnt understand at all the $&#40;window&#41; [...]]]></description>
			<content:encoded><![CDATA[<p> Hello </p>
<p> After working on the google shortcuts for a while, i decided to open up <acronym title="Internet Explorer">IE</acronym> 8 and see if the application works or not. I was surprised and started to do the old <code class="codecolorer javascript default"><span class="javascript"><span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;hax&quot;</span><span style="color: #009900;">&#41;</span></span></code> thing every dozen lines. The problem is with the <code class="codecolorer javascript default"><span class="javascript">$<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keypress</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></span></code>. It seems that <acronym title="Internet Explorer">IE</acronym> doesnt understand at all the <code class="codecolorer javascript default"><span class="javascript">$<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span></span></code> property at all when it comes with keypress/keydown/keyup events. </p>
<p><span id="more-166"></span></p>
<p> After some research, this is a known issue from <acronym title="Internet Explorer">IE</acronym>5 days, which is quite weird that jQuery didnt fix it in a way so it works with <code class="codecolorer javascript default"><span class="javascript">$<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span></span></code></p>
<p> However i did check the width/height properties and both values return different values. </p>
<h3> jQuery </h3>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// instead of $(window).keypress(function(){});</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// use </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keypress</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// this is the testing </span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> windowH <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> windowW <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> documentH <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> documentW <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>windowH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>documentH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>windowW<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>documentW<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p> I did look over this issue over Google but I couldnt find any information about it. Really sad you know. </p>
]]></content:encoded>
			<wfw:commentRss>http://alexdweb.com/blog/2009/12/28/jquery-ie-documentwindow-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Do Quick Shortcuts ala Google Mail Part 2</title>
		<link>http://alexdweb.com/blog/2009/11/28/how-to-do-quick-shortcuts-ala-google-mail-part-2/</link>
		<comments>http://alexdweb.com/blog/2009/11/28/how-to-do-quick-shortcuts-ala-google-mail-part-2/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 13:17:25 +0000</pubDate>
		<dc:creator>Dinulescu Alexandru Adrian</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[XHTML/CSS]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://alexdweb.com/blog/?p=111</guid>
		<description><![CDATA[Hello In this post I will elaborate and add more functionality to a previous post of mine found here here. Basically i have added more functionality to the page, such as left / right key navigation, number key functionality, enter/escape key functionality, and of course the entire suite of conditions needed so the code works [...]]]></description>
			<content:encoded><![CDATA[<p> Hello</p>
<p> In this post I will elaborate and add more functionality to a previous post of mine found <a href="http://alexdweb.com/blog/2009/11/24/how-to-do-quick-shortcuts-ala-google-mail-part-1/">here here</a>. Basically i have added more functionality to the page, such as left / right key navigation, number key functionality, enter/escape key functionality, and of course the entire suite of conditions needed so the code works properly. </p>
<p> I have tried to build each functionality as a module, which you can add and remove, however in order to have the search function work well with the tab functionality and switching, then some interdependence was needed. </p>
<h3> the XHTML </h3>
<p> The <acronym title="Extended HyperText Markup Language">XHTML</acronym> is not different from the last version, the only thing different is a few bits and pieces of additions, and more importantly a couple of new lists so we can have a tab functionality. Other than that, there were no major changes. </p>
<h3> the CSS </h3>
<p> As with the first version this <acronym title="Cascading Style Sheets">CSS</acronym> is very basic however you can style it as you wish, probably in the future i may add some nicer styles to the project but for now, since it&#8217;s just a tutorial thingy, i think what we have is quite enough. </p>
<h3> the JS </h3>
<p> The <acronym title="Javascript">JS</acronym> suffered major changes, (of course right, we&#8217;re building a <acronym title="Javascript">JS</acronym> application here). It is kinda hard to explain everything in the post, but all the lines (almost all the lines) are heavily commented within the <acronym title="Javascript">JS</acronym> file itself, so please refer to that file for exact instructions and explanations. </p>
<p> The files can also be found online <a href="http://alexdweb.com/blog/demo/wp-2/">Here</a> and a zip file can be downloaded from <a href='http://alexdweb.com/blog/2009/11/28/how-to-do-quick-shortcuts-ala-google-mail-part-2/wp-2/' rel='attachment wp-att-112'>here</a></p>
<p> In part 3 of the series i will try to enlarge the search possiblity to include more than 1 letter </p>
]]></content:encoded>
			<wfw:commentRss>http://alexdweb.com/blog/2009/11/28/how-to-do-quick-shortcuts-ala-google-mail-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery IE and ClearType Problem</title>
		<link>http://alexdweb.com/blog/2009/11/25/jquery-ie-and-cleartype-problem/</link>
		<comments>http://alexdweb.com/blog/2009/11/25/jquery-ie-and-cleartype-problem/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 12:45:22 +0000</pubDate>
		<dc:creator>Dinulescu Alexandru Adrian</dc:creator>
				<category><![CDATA[IE6 Bugs]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[cleartype]]></category>
		<category><![CDATA[IE Bugs]]></category>

		<guid isPermaLink="false">http://alexdweb.com/blog/?p=107</guid>
		<description><![CDATA[Hello Did it happen that when you use an animation such as fadeIn&#40;&#41;/fadeOut&#40;&#41; on a LCD screen, that has windows cleratype on (this happens automatically in windows vista+ but can be set on and off in windows XP), on IE (all versions), the text is not antialised anymore. This is due to the filter attribute [...]]]></description>
			<content:encoded><![CDATA[<p> Hello </p>
<p> Did it happen that when you use an animation such as <code class="codecolorer javascript default"><span class="javascript">fadeIn<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span>fadeOut<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></span></code> on a LCD screen, that has windows cleratype on (this happens automatically in windows vista+ but can be set on and off in windows XP), on <acronym title="Internet Explorer">IE</acronym> (all versions), the text is not antialised anymore. This is due to the filter attribute <acronym title="Internet Explorer">IE</acronym> browsers use to make the cleartype/stuff. </p>
<p> The solution is relatively simple, like putting a function callback on the <code class="codecolorer javascript default"><span class="javascript">fade <span style="color: #000066; font-weight: bold;">in</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span>fadeOut<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></span></code> such as: </p>
<h3> JQuery Code </h3>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp;$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.element&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeAttr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;filtered&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p> It&#8217;s not a perfect solution, and it may be a bit laggy and you can still SEE THE TEXT BEING CLEARTYPED, but at least it wont stay without cleartype and look like shit. Also this is the only way to do it until jQuery incorporates it&#8217;s own fix to counter <acronym title="Internet Explorer">IE</acronym>&#8216;s behavior.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexdweb.com/blog/2009/11/25/jquery-ie-and-cleartype-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Do Quick Shortcuts ala Google Mail Part 1</title>
		<link>http://alexdweb.com/blog/2009/11/24/how-to-do-quick-shortcuts-ala-google-mail-part-1/</link>
		<comments>http://alexdweb.com/blog/2009/11/24/how-to-do-quick-shortcuts-ala-google-mail-part-1/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 23:27:57 +0000</pubDate>
		<dc:creator>Dinulescu Alexandru Adrian</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[XHTML/CSS]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://alexdweb.com/blog/?p=87</guid>
		<description><![CDATA[Hello this post is the one of the things i have stumbled upon today I was working on a project and i was requested to do something ala Gmail shortcuts, aka you press a specific button and something happens, well, first off i looked on the web to see if there is any information, which [...]]]></description>
			<content:encoded><![CDATA[<p>Hello this post is the one of the things i have stumbled upon today</p>
<p> I was working on a project and i was requested to do something ala Gmail shortcuts, aka you press a specific button and something happens, well, first off i looked on the web to see if there is any information, which of course it&#8217;s not at least from what i looked so i had to build it myself </p>
<p> First off we&#8217;ll start with a basic <acronym title="Extended HyperText Markup Language">XHTML</acronym>, containing an un-ordered list, styled a bit, the real secret is the <acronym title="Javascript">JS</acronym> itself, you can style the <acronym title="Extended HyperText Markup Language">xhtml</acronym>/<acronym title="Cascading Style Sheets">css</acronym> as you want, it doesnt really matter. To save space i&#8217;ll upload the complete final files at the end of this post, with instructions and comented <acronym title="Cascading Style Sheets">css</acronym>/<acronym title="Extended HyperText Markup Language">xhtml</acronym>/jquery </p>
<p><span id="more-87"></span></p>
<h3> The XHTML </h3>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp;<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;pageWrap&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;desc&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span> This is Version 1 of the project. This demo now shows how you can press any letters<br />
&nbsp;and only the relevant names that start with that letter show up. In the future you can expect: further <br />
filtering, arrow navigation, special key functionality + more <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span>&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tip&quot;</span>&gt;</span> Press any letter to show only the names starting with that letter.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;msg&quot;</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;helpBox&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;container&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>John Smith<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>....names go here with or without an empty space , see below <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span> Jimmy Carter<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;clear&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></div>
<p> Okay what everything means is the <code class="codecolorer css default"><span class="css">p.tip</span></code> is basically a tip, how to use the system, not important in the <acronym title="Javascript">JS<acronym>. </p>
<p> the <code class="codecolorer css default"><span class="css">div.helpBox</span></code> is very important, because in <acronym title="Javascript">JS</acronym>, it will hold the letter the user typed, due to the <acronym title="Javascript">JS</acronym> used only 1 letter will be saved, the last one he typed. </p>
<p> the <code class="codecolorer css default"><span class="css">div<span style="color: #6666ff;">.container</span> ul</span></code> holds the <code class="codecolorer html4strict default"><span class="html4strict">li</span></code> elements that are the things we are interested in, and finally the <code class="codecolorer html4strict default"><span class="html4strict">li</span></code> tags hold the names we wish to search through. </p>
<p> Please note that after you understand how this works, you can change the <acronym title="Extended HyperText Markup Language">xhtml</acronym>/<acronym title="Cascading Style Sheets">css</acronym> structure to anything that suits you, this is just a demo, to show a concept. </p>
<p> Regarding the <acronym title="Javascript">JS</acronym> it is commented extensively within the file so please read that. It is possible to make it work for how many letters you want, however the code gets exponentially bigger as conditions have to be added, i will make a post about how to get 2-3 letters to work together very very easily after we build in more functionality in this post, like left/right navigation, what happens if you have different things u want sorted, and of course a top navigation that can switch between the various lists you have stored </p>
<p> Please note that this system can be used for a very extensive part, i posted about what you can do with a li tag in <a href="http://alexdweb.com/blog/2009/11/14/links-within-links-that-actually-work/">This Post</a> so you could read that also</p>
<p> Attached is a full functional demo, with the <acronym title="Javascrit">js</acronym> file commented at every step of the way, so for <acronym title="Javascript">js</acronym> instructions please refer there </p>
<p> In the next post i will show you how you can have left/right arrow keys functions, and in part 3 a top navigation bar, if you have multiple lists, and updated and enhanced left/right arrow key functionality to work with the new lists (this actually took me a while to figure out) AND in finally part 4 the ability to sort via 2 and 3 letters, each part being build on the code that is here ((this i havent done yet, so it will take some trial and error to do so this post may not come as soon as the other 2 parts </p>
<p> Here is the attached file <a href='http://alexdweb.com/blog/2009/11/24/how-to-do-quick-shortcuts-ala-google-mail-part-1/wp-1/' rel='attachment wp-att-96'>How To Do Quick Shortcuts ala Google Mail  Part 1</a> and a demo can be viewed online <a href="http://alexdweb.com/blog/demo/wp-1">HERE</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://alexdweb.com/blog/2009/11/24/how-to-do-quick-shortcuts-ala-google-mail-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google Chrome keypress bug</title>
		<link>http://alexdweb.com/blog/2009/11/22/google-chrome-keypress-bug/</link>
		<comments>http://alexdweb.com/blog/2009/11/22/google-chrome-keypress-bug/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 17:38:22 +0000</pubDate>
		<dc:creator>Dinulescu Alexandru Adrian</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Chrome Bug]]></category>
		<category><![CDATA[clean solution]]></category>

		<guid isPermaLink="false">http://alexdweb.com/blog/?p=92</guid>
		<description><![CDATA[Hello Did you knew that Google Chrome does not understand keypress&#40;&#41; on special keys like arrow keys/esc/enter/etc ? Me neither I was trying to get the following code to work and it didnt work in Google Chrome at all &#160; &#160; $&#40;window&#41;.keypress&#40;function&#40;e&#41;&#123; &#160; &#160; &#160; &#160; var code = &#40;e.keyCode ? e.keyCode : e.which&#41;; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p> Hello </p>
<p> Did you knew that Google Chrome does not understand <code class="codecolorer javascript default"><span class="javascript">keypress<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></span></code> on special keys like arrow keys/esc/enter/etc ? </p>
<p> Me neither </p>
<p> I was trying to get the following code to work and it didnt work in Google Chrome at all </p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keypress</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> code <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">keyCode</span> <span style="color: #339933;">?</span> e.<span style="color: #660066;">keyCode</span> <span style="color: #339933;">:</span> e.<span style="color: #660066;">which</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>code <span style="color: #339933;">==</span> <span style="color: #CC0000;">32</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span><span style="color: #CC0000;">65</span> <span style="color: #339933;">&lt;=</span> code <span style="color: #339933;">&amp;&amp;</span> code <span style="color: #339933;">&lt;=</span> <span style="color: #CC0000;">65</span> <span style="color: #339933;">+</span> <span style="color: #CC0000;">25</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span><span style="color: #CC0000;">97</span> <span style="color: #339933;">&lt;=</span> code <span style="color: #339933;">&amp;&amp;</span> code <span style="color: #339933;">&lt;=</span> <span style="color: #CC0000;">97</span> <span style="color: #339933;">+</span> <span style="color: #CC0000;">25</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;haxxor&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keypress</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> alphaCode <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>el.<span style="color: #660066;">keyCode</span> <span style="color: #339933;">?</span> el.<span style="color: #660066;">keyCode</span> <span style="color: #339933;">:</span> el.<span style="color: #660066;">which</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>alphaCode <span style="color: #339933;">==</span> <span style="color: #CC0000;">37</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;left key&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>alphaCode <span style="color: #339933;">==</span> <span style="color: #CC0000;">39</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;right key&quot;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> alphaCode <span style="color: #339933;">==</span> <span style="color: #CC0000;">13</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">alert</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;enter key&quot;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> alphaCode <span style="color: #339933;">==</span> <span style="color: #CC0000;">27</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">alert</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;escape key&quot;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p><span id="more-92"></span></p>
<p> The first function works, the second works in Firefox but not in Chrome. After much headbanging around the room i tried to replace <code class="codecolorer javascript default"><span class="javascript">keypress<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></span></code> with <code class="codecolorer javascript default"><span class="javascript">keydown<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></span></code> and surprise suprise, now it works. I really dont know what to say about this bug, works with any normal key but not with special keys. Do take notice of this bug so you dont waste 30+mins trying to figure out why this happens </p>
<p> Cheers </p>
]]></content:encoded>
			<wfw:commentRss>http://alexdweb.com/blog/2009/11/22/google-chrome-keypress-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript event.which / .keyCode / .charCode</title>
		<link>http://alexdweb.com/blog/2009/11/19/javascript-event-which-keycode-charcode/</link>
		<comments>http://alexdweb.com/blog/2009/11/19/javascript-event-which-keycode-charcode/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 14:52:03 +0000</pubDate>
		<dc:creator>Dinulescu Alexandru Adrian</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://alexdweb.com/blog/?p=89</guid>
		<description><![CDATA[Hello This is a post about the 3 properties in javascript, keypress, keyup and keydown. There are some small differences in the means to extract the data of the pressed key. First off to explain the 3 properties: keypress &#8211; this is both a keyup and keydown, it triggers when the key is pressed keyup [...]]]></description>
			<content:encoded><![CDATA[<p> Hello </p>
<p> This is a post about the 3 properties in javascript, keypress, keyup and keydown. There are some small differences in the means to extract the data of the pressed key. </p>
<p> First off to explain the 3 properties: </p>
<ul>
<li>keypress &#8211; this is both a keyup and keydown, it triggers when the key is pressed </li>
<li>keyup &#8211; this triggers when you lift your finger from a key </li>
<li>keydown -> this triggers when you drop your finger on a key </li>
</ul>
<p><span id="more-89"></span></p>
<p> And now the mind-bongling differences start to creep up. We have 2 properties that take the info stored <em>charCode</em> and <em>keyCode</em> </p>
<p> First off in a <strong>keypress</strong> event the key is stored in <strong> EITHER </strong> <em>keyCode</em> or <em>charCode</em>, but never both, . If the key pressed generates a character (e.g. &#8216;a&#8217;), <em>charCode</em> is set to the code of that character, respecting the letter case. (i.e. <em>charCode</em> takes into account whether the shift key is held down). Otherwise, the code of the pressed key is stored in <em>keyCode</em>. So basically means that if the key is a character is stored in the <em>charCode</em> property, else it&#8217;s stored in the <em>keyCode</em> property </p>
<p> To complicate the problems even further, <em>charCode</em> is never registered in keypress and keyup events, so <em>keyCode</em> is used there</p>
<p> So the solution is a system that checks for both options, <strong>.which</strong> property checks both <em>keyCode</em> and <em>charCode</em> but this doesnt always work with special keys (F1-F12/ESC/etc) so the solution used in a <strong>keypress</strong> event is</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;<span style="color: #003366; font-weight: bold;">var</span> code <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">keyCode</span> <span style="color: #339933;">?</span> e.<span style="color: #660066;">keyCode</span> <span style="color: #339933;">:</span> e.<span style="color: #660066;">which</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>code <span style="color: #339933;">==</span> <span style="color: #CC0000;">13</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//Enter keycode</span><br />
&nbsp; &nbsp;<span style="color: #006600; font-style: italic;">//Do something</span><br />
&nbsp;<span style="color: #009900;">&#125;</span></div></div>
<p> The above first checks for <em>e.keyCode</em>, if that is not used, then check for <strong>e.which</strong> which checks both <em>keyCode</em> and <em>charCode</em> properties. I dont know how it actually works, however through experimentation i have saw that <strong>.which</strong> doesnt always work, so i was forced to use the <em>.keyCode</em> property </p>
<p> Hopefully this can shed some light on this situation </p>
]]></content:encoded>
			<wfw:commentRss>http://alexdweb.com/blog/2009/11/19/javascript-event-which-keycode-charcode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Links within links that actually work</title>
		<link>http://alexdweb.com/blog/2009/11/14/links-within-links-that-actually-work/</link>
		<comments>http://alexdweb.com/blog/2009/11/14/links-within-links-that-actually-work/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 01:34:04 +0000</pubDate>
		<dc:creator>Dinulescu Alexandru Adrian</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[XHTML/CSS]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://alexdweb.com/blog/?p=75</guid>
		<description><![CDATA[Hello I just found out something very very interesting when i was working on a project. Basically it required me to put a div inside a a tag and that div also had some links. I managed to do that however the code is not valid. Will post source code with examples and explanations tomorrow. [...]]]></description>
			<content:encoded><![CDATA[<p> Hello </p>
<p> I just found out something very very interesting when i was working on a project. Basically it required me to put a <code class="codecolorer html4strict default"><span class="html4strict">div</span></code> inside a <code class="codecolorer html4strict default"><span class="html4strict">a</span></code> tag and that <code class="codecolorer html4strict default"><span class="html4strict">div</span></code> also had some links. I managed to do that however the code is not valid. Will post source code with examples and explanations tomorrow. </p>
<p> Okay so basically what I was trying to create was something like this (simplified for good reasons) </p>
<p> My version also had a hover <acronym title="Javascript">JS</acronym> element over the entire box, so when the user hovers over it, it gets highlighted. So far nothing went bad, everything fits together nicely </p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;box&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;./image/stuff.png&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;200px&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;200px&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span> <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span> Link 1 <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span> <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span> Link 2 <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></div>
<p><span id="more-75"></span></p>
<p> Attached is an image of said file </p>
<div><a href="http://alexdweb.com/blog/2009/11/14/links-within-links-that-actually-work/image1/" rel="attachment wp-att-79"><img src="http://alexdweb.com/blog/wp-content/uploads/2009/11/image1.jpg" alt="image1" title="image1" width="793" height="814" class="aligncenter size-full wp-image-79" /></a></div>
<p> The Challenge came when my client asked to encompass the entire <code class="codecolorer html4strict default"><span class="html4strict">div</span></code> into an <code class="codecolorer html4strict default"><span class="html4strict">a</span></code> tag so he could use it for redirecting to something else. Unfortunately as we know, <code class="codecolorer html4strict default"><span class="html4strict"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> &gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span></span></code> does not work, so i had to come up with a solution to this matter </p>
<p> The situation was quite easily done, since those boxes had to be floated, i could replace them with a <code class="codecolorer html4strict default"><span class="html4strict"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span></span></code> tag. However this was close but no cigar, since i still ended up with the old <code class="codecolorer html4strict default"><span class="html4strict"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span></span></code> situation. Then i thought about the <code class="codecolorer html4strict default"><span class="html4strict">span</span></code> tag and since the <code class="codecolorer html4strict default"><span class="html4strict">span</span></code> and <code class="codecolorer html4strict default"><span class="html4strict">div</span></code> tags are both <strong>MEANINGLESS</strong> and <strong> Almost identical in behavior </strong> i could simply replace the div with the span and just make sure to put the <code class="codecolorer css default"><span class="css"><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span></span></code> property on the <code class="codecolorer html4strict default"><span class="html4strict">span</span></code> so it will replicate the <code class="codecolorer html4strict default"><span class="html4strict">div</span></code>. and the <code class="codecolorer html4strict default"><span class="html4strict">span</span></code> tag works inside a <code class="codecolorer html4strict default"><span class="html4strict"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span></span></code> tag  </p>
<p> So my code at the end looked something like this: </p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">span</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;box&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;<a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span> <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span> Create Link <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span> | <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span>#<span style="color: #ff0000;">&quot;&gt;</span></span> Create Link <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">span</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span></div></div>
<p> However then i had a problem, the encompassing <code class="codecolorer html4strict default"><span class="html4strict">a</span></code> tag reduced my 2 inner <code class="codecolorer html4strict default"><span class="html4strict">a</span></code> tags useless. Given this situation I had to create another <code class="codecolorer html4strict default"><span class="html4strict">div</span></code> outside the encompassing <code class="codecolorer html4strict default"><span class="html4strict">a</span></code> tag and absolute-position that <code class="codecolorer html4strict default"><span class="html4strict">div</span></code> in the same place so it will look the same but behave totally different, now all links are working properly, and the user wont even notice the difference. The only thing not quite correct is that the code is not valid, but meh, sometime you have to cut some corners. </p>
<p> This is the almost the final draft with the code </p>
<p><a href="http://alexdweb.com/blog/2009/11/14/links-within-links-that-actually-work/image2/" rel="attachment wp-att-80"><img src="http://alexdweb.com/blog/wp-content/uploads/2009/11/image2.jpg" alt="image2" title="image2" width="786" height="742" class="aligncenter size-full wp-image-80" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://alexdweb.com/blog/2009/11/14/links-within-links-that-actually-work/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery stylesheet changer</title>
		<link>http://alexdweb.com/blog/2009/04/13/jquery-stylesheet-changer/</link>
		<comments>http://alexdweb.com/blog/2009/04/13/jquery-stylesheet-changer/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 00:24:42 +0000</pubDate>
		<dc:creator>Dinulescu Alexandru Adrian</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[XHTML/CSS]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://alexdweb.com/blog/?p=16</guid>
		<description><![CDATA[Hello I was always wondering what jQuery can do to help me give more power to my CSS stylesheets so one day after some time spent on the web i discovered a very very simple solution that was so easy to install that i was baffled that i couldnt figure it out a lot sooner. [...]]]></description>
			<content:encoded><![CDATA[<p> Hello </p>
<p>I was always wondering what jQuery can do to help me give more power to my <acronym title="Cascading Style Sheets">CSS</acronym> stylesheets so one day after some time spent on the web i discovered a very very simple solution that was so easy to install that i was baffled that i couldnt figure it out a lot sooner. So without further comments here is the rundown of the stuff.</p>
<p><span id="more-16"></span></p>
<h3>the XHTML</h3>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nav&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;path/to/file&quot;</span>&gt;</span> Stylesheet 1 <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;path/to/file&quot;</span>&gt;</span> Stylesheet 2 <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;path/to/file&quot;</span>&gt;</span> Stylesheet 3 <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span></div></div>
<p>It&#8217;s very straightforward very easy to implement</p>
<p>You may wonder why i didnt use the <code class="codecolorer html4strict default"><span class="html4strict">href</span></code> tag instead, well if the user has javascript turned off, then it means that he will be redirected to the <acronym title="Cascading Style Sheets">CSS</acronym> file in question rather than just changing the file which is very very bad so thats why we are using the rel attribute.</p>
<h3>The  jQuery</h3>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#nav li a&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;link&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;href&quot;</span><span style="color: #339933;">,</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;rel&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></div></div>
<p>What did we do here? Simple, everytime a user clicks one of the links in the nav id, the <code class="codecolorer html4strict default"><span class="html4strict">rel</span></code> attribute we specified is given to the LINK element in the head section of the page. the link element is the tag which inserts external <acronym title="Cascading Style Sheets">CSS</acronym> files, so by changing that we CHANGE how the site looks.</p>
<p>Now since we did that and it works, users may be annoyed to do this everytime they enter your site, so it&#8217;s a good thing we have the cookie jquery plugin which sorts all our issues. so with some small tweaks to the jquery code we get something like this</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$.<span style="color: #660066;">cookie</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;css&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;link&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;href&quot;</span><span style="color: #339933;">,</span> $.<span style="color: #660066;">cookie</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;css&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#nav li a&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;link&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;href&quot;</span><span style="color: #339933;">,</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;rel&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $.<span style="color: #660066;">cookie</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;css&quot;</span><span style="color: #339933;">,</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;rel&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> expires<span style="color: #339933;">:</span> <span style="color: #CC0000;">365</span><span style="color: #339933;">,</span> path<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;/&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></div></div>
<p>Now everything is AOK, only that the user sheets a small shutter everytime they load the page, since javascript is loaded after the <acronym title="HyperText Markup Language">HTML</acronym> and <acronym title="Cascading Style Sheets">CSS</acronym> is loaded. to prevent that we can put the if statement ABOVE the document ready function. This is not recommended most of the times but since we know exactly WHAT to manipulate we can do this on this occasion.</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$.<span style="color: #660066;">cookie</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;css&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;link&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;href&quot;</span><span style="color: #339933;">,</span> $.<span style="color: #660066;">cookie</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;css&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#nav li a&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;link&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;href&quot;</span><span style="color: #339933;">,</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;rel&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $.<span style="color: #660066;">cookie</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;css&quot;</span><span style="color: #339933;">,</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;rel&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> expires<span style="color: #339933;">:</span> <span style="color: #CC0000;">365</span><span style="color: #339933;">,</span> path<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;/&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></div></div>
<p> In case people didnt know this is the order you need to put link the scripts/<acronym title="Cascading Style Sheets">CSS</acronym> in order for this technique to work. </p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/link.html"><span style="color: #000000; font-weight: bold;">link</span></a> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/path/to/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/js/jQueryLib.js&quot;</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/js/jQueryCookie.js&quot;</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/js/changeCSS.js&quot;</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span></div></div>
<p>And that is all, nice nifty webpage that does the trick and helps you out enormously when you try to make larger font sizes and stuff like that, even for skinning purposes.</p>
<p>Questions in comments, will answer all of them.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexdweb.com/blog/2009/04/13/jquery-stylesheet-changer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nifty Vertical Height Javascript JQuery</title>
		<link>http://alexdweb.com/blog/2009/04/08/nifty-vertical-height-javascript-jquery/</link>
		<comments>http://alexdweb.com/blog/2009/04/08/nifty-vertical-height-javascript-jquery/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 18:53:34 +0000</pubDate>
		<dc:creator>Dinulescu Alexandru Adrian</dc:creator>
				<category><![CDATA[IE6 Bugs]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[IE Bugs]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[XHTML/CSS]]></category>

		<guid isPermaLink="false">http://alexdweb.com/blog/?p=14</guid>
		<description><![CDATA[Evening All. Everyone loved valign=&#8221;middle&#8221; on tables&#8230; well life just got better with jQuery. This plugin works flawlessly however make sure that both the element itself and the parent element do not have any top/bottom paddings, else please modify it using the .outerHeight&#40;&#41; property that takes into consideration the padding/border of those elements. Tweak and [...]]]></description>
			<content:encoded><![CDATA[<p> Evening All. </p>
<p> Everyone loved valign=&#8221;middle&#8221; on tables&#8230; well life just got better with jQuery. This plugin works flawlessly however make sure that both the element itself and the parent element do not have any top/bottom paddings, else please modify it using the <code class="codecolorer javascript default"><span class="javascript">.<span style="color: #660066;">outerHeight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></span></code> property that takes into consideration the padding/border of those elements. Tweak and use as necessary. </p>
<p><span id="more-14"></span></p>
<h3> the JQuery </h3>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #006600; font-style: italic;">// VERTICALLY ALIGN FUNCTION</span><br />
$.<span style="color: #660066;">fn</span>.<span style="color: #660066;">vAlign</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> ah <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> ph <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> mh <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>ph <span style="color: #339933;">-</span> ah<span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'paddingTop'</span><span style="color: #339933;">,</span> mh<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>You can get the benefits of valign=middle no problem.</p>
<p>So just put the jQuery framework script then this script above and call the elements you want to be valigned=middle by using this</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">vAlign</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></div></div>
<p>Also another VERY NIFTY thing to do is, in order to prevent the user from seeing the javascript process (since first <acronym title="HyperText Markup Language">HTML</acronym> is loaded, then <acronym title="Cascading Style Sheets">CSS</acronym> file is loaded, then any images are loaded, then <acronym title="Javascript">JS</acronym> is processed) you can do this. </p>
<p> First you need an <code class="codecolorer css default"><span class="css">.outerBox</span></code> that encompasses the Box element, and then you need to have the box element with a declared height, like <code class="codecolorer css default"><span class="css"><span style="color: #cc00cc;">#box</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></span></code>. This workaround is only good for <acronym title="Internet Explorer 6">IE</acronym> 6 since that sucks donkey balls, and has a <acronym title="Javascript">JS</acronym> rendering engine from 1000AD. however depending on the amount of content being displayed (like entire columns) <acronym title="Internet Explorer">IE</acronym>7 which appeared in 2000AD may require this fix also. Other browsers are OK so this is BS </p>
<h3> CSS: </h3>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #cc00cc;">#outerBox</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span><br />
<span style="color: #cc00cc;">#box</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> xxxpx<span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></div></div>
<h3> Javascript: </h3>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">function</span> alignThis<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">vAlign</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;outerBox&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;display&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;block&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p> End of story. </p>
<p>
And for the other more compatible browsers you can put this in another <acronym title="Javascript">JS</acronym> file. The previous one was inserted in the <acronym title="HyperText Markup Language">HTML</acronym> using conditional comments <code class="codecolorer html4strict default"><span class="html4strict"><span style="color: #808080; font-style: italic;">&lt;!--[if IE lte 7]&gt; &lt;script src=&quot;./../js/biteMe.js&quot; type=&quot;text/javascript&quot;/&gt;&lt;![endif]--&gt;</span></span></code> </p>
<p> <code class="codecolorer javascript default"><span class="javascript">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">vAlign</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></span></code> and just use Conditional comments to put the <acronym title="Internet Explorer">IE</acronym> specific things in so they wont see them, and since you are linking 2 different <acronym title="Javascript">JS</acronym> files, (again with conditional comments) you script WONT JAM.
</p>
<p> Complex solution for an ancient problem. </p>
<p> Cheers </p>
]]></content:encoded>
			<wfw:commentRss>http://alexdweb.com/blog/2009/04/08/nifty-vertical-height-javascript-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

