<?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>Altryne's Blog &#187; javascript</title>
	<atom:link href="http://alexw.me/tags/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://alexw.me</link>
	<description>Not everyday I get to learn "nothing"</description>
	<lastBuildDate>Fri, 04 Jun 2010 20:06:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Simlest jquery rounded tabs with some css3</title>
		<link>http://alexw.me/2010/02/simle-jquery-rounded-tabs/</link>
		<comments>http://alexw.me/2010/02/simle-jquery-rounded-tabs/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 21:05:53 +0000</pubDate>
		<dc:creator>Altryne</dc:creator>
				<category><![CDATA[Playing with stuff]]></category>
		<category><![CDATA[Css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[xHtml]]></category>

		<guid isPermaLink="false">http://alexw.me/?p=176</guid>
		<description><![CDATA[This is a solution for tabbed interface I wrote while working on a high profile project at work. It uses jQuery and about 3 lines of code to create it(plus some css+xtml). Very easy indeed. I know there are a LOT of tab plugins avaliable out-there, I used them myself. A lot. The problem was, [...]]]></description>
			<content:encoded><![CDATA[<p>This is a solution for tabbed interface I wrote while working on a high profile project at work. It uses jQuery and about 3 lines of code to create it(plus some css+xtml). Very easy indeed.<br />
I know there are a LOT of <a title="simple tabs with jquery" href="http://www.sohtanaka.com/web-design/simple-tabs-w-css-jquery/" target="_blank">tab</a> <a title="jQuery ui tabs" href="http://docs.jquery.com/UI/Tabs" target="_blank">plugins</a> <a title="Tabs using animation effects" href="http://stilbuero.de/jquery/tabs/" target="_blank">avaliable</a> out-there, I used them myself. A lot.<br />
The problem was, I wanted a quick solution, without the bells and whiles of animation and FX. This is what came out.</p>
<p><a href="http://alexw.me/playground/tabs.html">SEE DEMO HERE<br />
</a></p>
<p><strong><span style="font-size: medium;">Step one : xHtml markup</span></strong></p>
<p><strong><span style="font-size: medium;"><span id="more-176"></span><br />
</span></strong></p>
<p>I decided to use the most basic structure. 2 wrappers next to each other, one containing the actual tabs, the other the relative content to each tab. Both elements(tabs and content) receive the &#8216;active&#8217; class when their are in fact <strong>active</strong>.</p>
<pre class="brush: html">
&lt;ul id=&quot;tabz&quot;&gt;
&lt;li class=&quot;tab active&quot;&gt;Tab1&lt;/li&gt;
&lt;li class=&quot;tab &quot;&gt;Tab2&lt;/li&gt;
&lt;li class=&quot;tab &quot;&gt;Tab3&lt;/li&gt;
&lt;/ul&gt;
&lt;div id=&quot;tabz_cont&quot;&gt;
&lt;div class=&quot;cont active&quot;&gt;Content 1&lt;/div&gt;
&lt;div class=&quot;cont&quot;&gt;Content 2&lt;/div&gt;
&lt;div class=&quot;cont&quot;&gt;
&lt;h1&gt;some other content&lt;/h1&gt;
Content 1

&lt;/div&gt;
&lt;/div&gt;
</pre>
<p><strong><span style="font-size: medium;">Step two : Css</span></strong></p>
<p><span>I used a grid system (<a href="http://960.gs)">http://960.gs)</a> to position and give widths to all the elements, beside that, I used some css3 techniques to beatify my tabs (rounded corners and shadow).</span><br />
The actual css you use, isn&#8217;t important to the work of the <strong>tabz</strong>.</p>
<p><span style="font-size: large;"><strong>Step three : JAVASCRIPT</strong></span></p>
<p>This is the reason why you are reading this, right? here you go:</p>
<pre class="brush: js">
//Tabz code - apply event to the tabs elements and your done
$(&#039;#tabz li&#039;).live(&#039;click&#039;,function(){
_index = $(this).parent().children().index($(this));
$(this).addClass(&#039;active&#039;).siblings().removeClass(&#039;active&#039;);
$(&#039;.cont&#039;).removeClass(&#039;active&#039;).eq(_index).addClass(&#039;active&#039;);
});
</pre>
<p>I select the tabs and assign them a click event listener, with the <strong>live()</strong> function.</p>
<p>Then I create an <strong>_index</strong> variable, that will tel me the index of the tab inside it&#8217;s parent.</p>
<p>By this <strong>_index</strong> I can now show the relevant content in the content div(the tabs and their content <strong>have </strong> to be the same index in their respective containers)</p>
<p>That&#8217;s it. Hope you can use this. If you do, don&#8217;t forget to comment here and show me your work.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexw.me/2010/02/simle-jquery-rounded-tabs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash to Javascript (mootools) ?</title>
		<link>http://alexw.me/2009/02/flash-to-javascript-mootools/</link>
		<comments>http://alexw.me/2009/02/flash-to-javascript-mootools/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 21:29:19 +0000</pubDate>
		<dc:creator>Altryne</dc:creator>
				<category><![CDATA[Playing with stuff]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[Mootools]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[xHtml]]></category>

		<guid isPermaLink="false">http://alexw.me/?p=53</guid>
		<description><![CDATA[Ok, so if you still haven&#8217;t checked my &#8220;flash site&#8221; yet, you really should. I&#8217;s a consept website, in flash, I created some time ago and didn&#8217;t finish. It has a couple if nifty things to play with (draggable birds, media buttons in form of floating balloons,a very unique panoramic background) And I decided to [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, so if you still haven&#8217;t checked my &#8220;<a title="Go to my flash website" href="/flash/">flash site</a>&#8221; yet, you really should.</p>
<p>I&#8217;s a consept website, in flash, I created some time ago and didn&#8217;t finish.</p>
<p>It has a couple if nifty things to play with (draggable birds, media buttons in form of floating balloons,a very unique panoramic background)</p>
<p>And I decided to port this whole thing into JS with MooTools and it&#8217;s FX.Scroll function.</p>
<p>So in the next couple of days I will be posting the results here and the code also.</p>
<p>Cheerz</p>
]]></content:encoded>
			<wfw:commentRss>http://alexw.me/2009/02/flash-to-javascript-mootools/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fade in/out effect makes text Garbled. /strange</title>
		<link>http://alexw.me/2009/02/fade-inout-effect-makes-text-garbled-strange/</link>
		<comments>http://alexw.me/2009/02/fade-inout-effect-makes-text-garbled-strange/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 22:22:03 +0000</pubDate>
		<dc:creator>Altryne</dc:creator>
				<category><![CDATA[Problems and Fixes]]></category>
		<category><![CDATA[Css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Mootools]]></category>
		<category><![CDATA[xHtml]]></category>

		<guid isPermaLink="false">http://alexw.me/?p=13</guid>
		<description><![CDATA[<h1>Prologue :</h1>
Ok so i'm working on this site at work, and our creative designers decided it should have a news ticker in Javascipt. A fade-in/out kind of thing.]]></description>
			<content:encoded><![CDATA[<h1>Prologue :</h1>
<p>Ok so i&#8217;m working on this site at work, and our creative designers decided it should have a news ticker in Javascipt. A fade-in/out kind of thing.</p>
<p>I used <strong>Mootools</strong> (of course) to write a simple script for this. And then I noticed something very strange. While in transition, both in Firefox and IE (6 and 7) the text got Garbled and rendered strangely.</p>
<h1>Problem :</h1>
<p>I then noticed this deal on another websites :<br />
<div id="attachment_14" class="wp-caption alignnone" style="width: 511px"><img class="size-full wp-image-14" title="getstisfaction.com" src="http://alexw.me/wp-content/uploads/2009/02/getstisfaction.jpg" alt="getstisfaction.com " width="501" height="341" /><p class="wp-caption-text">getstisfaction.com </p></div><br />
<span id="more-13"></span></p>
<h1>Preview :</h1>
<p>I tried to recreate this , and I made it happen only in IE for some reason.<br />
<Iframe border="0" frameborder="0" width="500" height="200" src="http://alexw.me/html_examples/show_hide_garlbed.php"></iframe></p>
<h1>FIX :</h1>
<p>All that needs to be done, is to add background color to the absolute positioned elements that get faded in and out&#8230;</p>
<p>like so :<br />
<code><br />
.fade_div{<br />
position:absolute;<br />
background-color:#fff;<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://alexw.me/2009/02/fade-inout-effect-makes-text-garbled-strange/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
