<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Sarfraz Ahmed&#039;s Blog</title>
	<atom:link href="http://sarfraznawaz.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sarfraznawaz.wordpress.com</link>
	<description>PHP, ASP, JQuery, Ajax, CSS, Javascript, MySQL, Frameworks</description>
	<lastBuildDate>Wed, 25 Jan 2012 19:39:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sarfraznawaz.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/9f95e00fa9abb3da248b60527746da74?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Sarfraz Ahmed&#039;s Blog</title>
		<link>http://sarfraznawaz.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sarfraznawaz.wordpress.com/osd.xml" title="Sarfraz Ahmed&#039;s Blog" />
	<atom:link rel='hub' href='http://sarfraznawaz.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Javascript Self Invoking Functions</title>
		<link>http://sarfraznawaz.wordpress.com/2012/01/26/javascript-self-invoking-functions/</link>
		<comments>http://sarfraznawaz.wordpress.com/2012/01/26/javascript-self-invoking-functions/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 19:39:26 +0000</pubDate>
		<dc:creator>Sarfraz Ahmed</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[anonymous]]></category>
		<category><![CDATA[best-practices]]></category>
		<category><![CDATA[executing]]></category>
		<category><![CDATA[invoking]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[self]]></category>

		<guid isPermaLink="false">http://sarfraznawaz.wordpress.com/?p=794</guid>
		<description><![CDATA[In this article, I will discuss self-executing or self-invoking functions of javascript and their hidden power with real-world example. We will also see why using setInterval is bad in some situations and should be avoided. Let’s explore little used but extremely powerful self-invoking functions of javascript. Self-Invoking Anonymous Function A self-invoking anonymous runs automatically/immediately when you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarfraznawaz.wordpress.com&amp;blog=7055774&amp;post=794&amp;subd=sarfraznawaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this article, I will discuss self-executing or self-invoking functions of javascript and their hidden power with real-world example. We will also see why using <strong>setInterval</strong> is bad in <strong>some</strong> situations and should be avoided. Let’s explore little used but extremely powerful self-invoking functions of javascript.</p>
<h3><strong>Self-Invoking Anonymous Function</strong></h3>
<p>A self-invoking anonymous runs automatically/immediately when you create it and has no name, hence called anonymous. Here is the format of self-executing anonymous function:</p>
<p><pre class="brush: jscript;">
(function(){
 // some code…
})();
</pre></p>
<p>&nbsp;</p>
<p>You must be aware of the fact that javascript functions run immediately when you put<strong> ()</strong> after their names eg:</p>
<p><pre class="brush: jscript;">

doStuff(); // this will run immediately
</pre></p>
<p>And:</p>
<p><pre class="brush: jscript;">

doStuff; // this will not run immediately and can be used as callback
</pre></p>
<p>Now because <strong>()</strong> exist at the end of self-executing anonymous function above, it will run immediately.</p>
<p>Interestingly, if you look at the <a href="http://code.jquery.com/jquery-1.4.4.js" target="_blank">source code of jQuery</a>, you will see that everything is wrapped in between:</p>
<p><pre class="brush: jscript;">
(function( window, undefined ) {
 // jQuery code
})(window);
</pre></p>
<p>That is as can be seen also a self-executing anonymous function with arguments. A <strong>window </strong>(and <strong>undefined</strong>) argument is created and is mapped with global <strong>window </strong>object at the bottom <strong>(window)</strong>.</p>
<p>Notice that you can also write self-executing anonymous function like this:</p>
<p><pre class="brush: jscript;">
function(){
 // some code…
}();
</pre></p>
<p>Using extra braces like before <strong>function</strong> keyword is simply coding convention and is used even by famous javascript libraries such as <a href="http://jquery.com/" target="_blank">jQuery</a> and also recommended by <a href="http://www.crockford.com/" target="_blank">Douglas Crockford</a>. If you are confused about that extra pair of braces, here is another easy to remember notation:</p>
<p><pre class="brush: jscript;">

! function(){
// some code…
}();
</pre></p>
<div>Notice the addition of <strong>! </strong>before <strong>function</strong> keyword, it is essentially same in functionality to previous notation and also recommended (used by twitter too), quoting <a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm" target="_blank">docs, section 12.4</a>:</div>
<div></div>
<div></div>
<blockquote>
<div>An <em>ExpressionStatement</em> cannot start with the <code>function</code> keyword because that might make it ambiguous with a <em>FunctionDeclaration</em>.</div>
</blockquote>
<div>
<h3>Self-Executing Function</h3>
<p>Self-Executing function is a <strong>named</strong> function that runs immediately. Example:</p>
<p><pre class="brush: jscript;">

function foo(){
 // some code…
}()
</pre></p>
<p>Notice that now that we have named our function <strong>foo</strong>, it is not an anonymous function though it still is self-executing function because of<strong> ()</strong> at the end.</p>
<h3>How do they run automatically?</h3>
<p>This can be best explained through an example. Let’s say in your webpage you have this javascript code:</p>
<p><pre class="brush: jscript;">

function showUp(){
 alert(’Hello There’);
}
</pre></p>
<p>When you visit the page, the showUp function will not get triggered unless you do so by calling the function:</p>
<p><pre class="brush: jscript;">

function showUp(){
 alert(’Hello There’);
}

// run the function
showUp();
</pre></p>
<p>However, you can make the function auto-run by making it self-executing function like this:</p>
<p><pre class="brush: jscript;">
function showUp(){
alert(’Hello There’);
}()
</pre></p>
<div>
<h3>Where to use self-executing functions?</h3>
<p>One obvious situation is when you want to auto-run a function like I showed in above example but that is trivial. If you are in a situation where you want to run a piece of code repeatedly like updating something in the database based on user interaction or fetching records from database every 10 seconds or you want to load new stories via ajax similar to how facebook does on its homepage or some other similar situation, one would normally go for setInterval function something like this:</p>
<p><pre class="brush: jscript;">
setInterval(doStuff, 10000);
</pre></p>
<p>Above, doStuff function will get called every 10 seconds. That is the normal approach most developers seem to go with. However, there is a huge problem with that. The setInterval will call doStuff function exactly at specified time of 10 seconds again and again irrespective of whether doStuff function actually finished doing what it is supposed to do. That is bad and will certainly get you into unexpected results.</p>
<p>That is one example of where <strong>setInterval</strong> is ^bad^ and should be avoided.</p>
<p>This is exactly where self-executing functions come in handy. We can do the same task with the help of self-executing function along with setTimeout like this:</p>
<p><pre class="brush: jscript;">
! function foo(){
 // your other code here

setTimeout(foo, 10000);

}();
</pre></p>
<p>This code will also repeat itself again and again with one difference. setTimeout will never get triggered unless doStuff is finished. A much better approach than using <strong>setInterval</strong> in this situation.</p>
<p><a href="http://jsbin.com/usali4" target="_blank"><strong>You can see the example in action here.</strong></a></p>
</div>
</div>
<br />Filed under: <a href='http://sarfraznawaz.wordpress.com/category/javascript/'>Javascript</a>, <a href='http://sarfraznawaz.wordpress.com/category/jquery/'>JQuery</a> Tagged: <a href='http://sarfraznawaz.wordpress.com/tag/anonymous/'>anonymous</a>, <a href='http://sarfraznawaz.wordpress.com/tag/best-practices/'>best-practices</a>, <a href='http://sarfraznawaz.wordpress.com/tag/executing/'>executing</a>, <a href='http://sarfraznawaz.wordpress.com/tag/invoking/'>invoking</a>, <a href='http://sarfraznawaz.wordpress.com/tag/javascript/'>Javascript</a>, <a href='http://sarfraznawaz.wordpress.com/tag/jquery/'>JQuery</a>, <a href='http://sarfraznawaz.wordpress.com/tag/js/'>js</a>, <a href='http://sarfraznawaz.wordpress.com/tag/self/'>self</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sarfraznawaz.wordpress.com/794/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sarfraznawaz.wordpress.com/794/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sarfraznawaz.wordpress.com/794/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sarfraznawaz.wordpress.com/794/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sarfraznawaz.wordpress.com/794/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sarfraznawaz.wordpress.com/794/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sarfraznawaz.wordpress.com/794/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sarfraznawaz.wordpress.com/794/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sarfraznawaz.wordpress.com/794/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sarfraznawaz.wordpress.com/794/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sarfraznawaz.wordpress.com/794/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sarfraznawaz.wordpress.com/794/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sarfraznawaz.wordpress.com/794/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sarfraznawaz.wordpress.com/794/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarfraznawaz.wordpress.com&amp;blog=7055774&amp;post=794&amp;subd=sarfraznawaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sarfraznawaz.wordpress.com/2012/01/26/javascript-self-invoking-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b4af6fbcb37d41021119636bc1a2e12?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Sarfraz Ahmed</media:title>
		</media:content>
	</item>
		<item>
		<title>Free Admin Template</title>
		<link>http://sarfraznawaz.wordpress.com/2012/01/14/free-admin-template/</link>
		<comments>http://sarfraznawaz.wordpress.com/2012/01/14/free-admin-template/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 17:23:26 +0000</pubDate>
		<dc:creator>Sarfraz Ahmed</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[MISC]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://sarfraznawaz.wordpress.com/?p=785</guid>
		<description><![CDATA[While working on a website or your custom CMS, you need to have an admin template and if you are already provided with one by designer or anyone, that&#8217;s good but sometimes you don&#8217;t have that option or you want to work on your personal project for which you need the admin template but designer [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarfraznawaz.wordpress.com&amp;blog=7055774&amp;post=785&amp;subd=sarfraznawaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While working on a website or your custom CMS, you need to have an admin template and if you are already provided with one by designer or anyone, that&#8217;s good but sometimes you don&#8217;t have that option or you want to work on your personal project for which you need the admin template but designer isn&#8217;t available or you don&#8217;t want to buy an admin template or hire a designer. I often come across this requirement where I need an admin template which should have these features:</p>
<ul>
<li>Easy to customize</li>
<li>Slick and nice looking interface</li>
<li>Can be modified to as many links as needed, suitable for small to big websites</li>
<li>Nice button and form styles</li>
<li>Nice looking info messages</li>
<li>Can be used as admin for any kind of website</li>
</ul>
<p>Today I share with you guys an admin template that I created for my personal use. That&#8217;s free, you can use it for personal or commercial use.</p>
<h2>Screenshots:</h2>
<a href="http://sarfraznawaz.wordpress.com/2012/01/14/free-admin-template/#gallery-1-slideshow">Click to view slideshow.</a>
<h3><a title="Download" href="http://sarfraznawaz2005.kodingen.com/demos/other/my-admin.zip" target="_blank">Download</a></h3>
<br />Filed under: <a href='http://sarfraznawaz.wordpress.com/category/css/'>CSS</a>, <a href='http://sarfraznawaz.wordpress.com/category/html5/'>HTML5</a>, <a href='http://sarfraznawaz.wordpress.com/category/misc/'>MISC</a>, <a href='http://sarfraznawaz.wordpress.com/category/php/'>PHP</a> Tagged: <a href='http://sarfraznawaz.wordpress.com/tag/admin/'>admin</a>, <a href='http://sarfraznawaz.wordpress.com/tag/css/'>CSS</a>, <a href='http://sarfraznawaz.wordpress.com/tag/custom/'>custom</a>, <a href='http://sarfraznawaz.wordpress.com/tag/free/'>free</a>, <a href='http://sarfraznawaz.wordpress.com/tag/html/'>html</a>, <a href='http://sarfraznawaz.wordpress.com/tag/php/'>PHP</a>, <a href='http://sarfraznawaz.wordpress.com/tag/template/'>template</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sarfraznawaz.wordpress.com/785/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sarfraznawaz.wordpress.com/785/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sarfraznawaz.wordpress.com/785/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sarfraznawaz.wordpress.com/785/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sarfraznawaz.wordpress.com/785/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sarfraznawaz.wordpress.com/785/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sarfraznawaz.wordpress.com/785/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sarfraznawaz.wordpress.com/785/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sarfraznawaz.wordpress.com/785/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sarfraznawaz.wordpress.com/785/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sarfraznawaz.wordpress.com/785/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sarfraznawaz.wordpress.com/785/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sarfraznawaz.wordpress.com/785/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sarfraznawaz.wordpress.com/785/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarfraznawaz.wordpress.com&amp;blog=7055774&amp;post=785&amp;subd=sarfraznawaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sarfraznawaz.wordpress.com/2012/01/14/free-admin-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b4af6fbcb37d41021119636bc1a2e12?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Sarfraz Ahmed</media:title>
		</media:content>
	</item>
		<item>
		<title>Outputting PHP To Browser Console</title>
		<link>http://sarfraznawaz.wordpress.com/2012/01/05/outputting-php-to-browser-console/</link>
		<comments>http://sarfraznawaz.wordpress.com/2012/01/05/outputting-php-to-browser-console/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 10:53:28 +0000</pubDate>
		<dc:creator>Sarfraz Ahmed</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[speed]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://sarfraznawaz.wordpress.com/?p=779</guid>
		<description><![CDATA[Although there exist classes for outputting PHP to browser console such as Google&#8217;s PHP Console and certain others, I was looking for a way to output PHP to browser console without including those classes in my PHP files or installing any browsesr plugin to do the same. Currently, I am working on facebook application development [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarfraznawaz.wordpress.com&amp;blog=7055774&amp;post=779&amp;subd=sarfraznawaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://sarfraznawaz.files.wordpress.com/2012/01/console.gif"><img class="alignleft size-full wp-image-780" title="console" src="http://sarfraznawaz.files.wordpress.com/2012/01/console.gif?w=540" alt=""   /></a></p>
<p>Although there exist <em><strong>classes</strong></em> for outputting PHP to browser console such as Google&#8217;s <strong>PHP Console</strong> and certain others, I was looking for a way to output PHP to browser console without including those <em>classes</em> in my PHP files or installing any browsesr plugin to do the same. Currently, I am working on facebook application development in which you have to commit/upload the code to check certain output out of PHP unlike offline development where you check the code output before committing it up. This makes facebook application development a longer process for a developer but you got to live with it because you don&#8217;t have a choice.</p>
<p>Anyways, to speed up the code output checking process a little and rather using <strong>debug_backtrace, print_r, print/echo, var_dump, etc</strong> which you need to remove/comment again, I created a <strong>function</strong> to get output of PHP on the browser console. One could use <strong>error_log</strong> function but even that makes you go to your log file and then see the output. Of course, browser needs to support/have the console so that code result is output there. Because IE less than 8 doesn&#8217;t have console, this won&#8217;t work in IE less than 8, though result won&#8217;t be affected in it. Notice that you can see console in IE=&gt;8 by pressing <strong>F12</strong> key and then going to <strong>Script</strong> tab where you need to make sure <strong>Console</strong> tab is selected on the right side.</p>
<p>Here is the function:</p>
<p><pre class="brush: php;">
     /**
     * Logs messages/variables/data to browser console from within php
     *
     * @param $name: message to be shown for optional data/vars
     * @param $data: variable (scalar/mixed) arrays/objects, etc to be logged
     * @param $jsEval: whether to apply JS eval() to arrays/objects
     *
     * @return none
     * @author Sarfraz
     */
     function logConsole($name, $data = NULL, $jsEval = FALSE)
     {
          if (! $name) return false;

          $isevaled = false;
          $type = ($data || gettype($data)) ? 'Type: ' . gettype($data) : '';

          if ($jsEval &amp;&amp; (is_array($data) || is_object($data)))
          {
               $data = 'eval(' . preg_replace('#[\s\r\n\t&#092;&#048;\x0B]+#', '', json_encode($data)) . ')';
               $isevaled = true;
          }
          else
          {
               $data = json_encode($data);
          }

          # sanitalize
          $data = $data ? $data : '';
          $search_array = array(&quot;#'#&quot;, '#&quot;&quot;#', &quot;#''#&quot;, &quot;#\n#&quot;, &quot;#\r\n#&quot;);
          $replace_array = array('&quot;', '', '', '\\n', '\\n');
          $data = preg_replace($search_array,  $replace_array, $data);
          $data = ltrim(rtrim($data, '&quot;'), '&quot;');
          $data = $isevaled ? $data : ($data[0] === &quot;'&quot;) ? $data : &quot;'&quot; . $data . &quot;'&quot;;

$js = &lt;&lt;&lt;JSCODE
\n&lt;script&gt;
     // fallback - to deal with IE (or browsers that don't have console)
     if (! window.console) console = {};
     console.log = console.log || function(name, data){};
     // end of fallback

     console.log('$name');
     console.log('------------------------------------------');
     console.log('$type');
     console.log($data);
     console.log('\\n');
&lt;/script&gt;
JSCODE;

          echo $js;
     } # end logConsole
</pre></p>
<p>Here is an example of how to use it:</p>
<p><pre class="brush: php;">
$name = 'sarfraz';

$fruits = array(&quot;banana&quot;, &quot;apple&quot;, &quot;strawberry&quot;, &quot;pineaple&quot;);

$user = new stdClass;
$user-&gt;name = &quot;Sarfraz&quot;;
$user-&gt;desig = &quot;Sr. Software Engineer&quot;;
$user-&gt;lang = &quot;PHP&quot;;

logConsole('$name var', $name, true);
logConsole('An array of fruits', $fruits, true);
logConsole('$user object', $user, true);
</pre></p>
<p>Above code will result in what is shown in the image above. Although this does not prevent committing code first to see the code output if you are on <em>facebook application development</em> but it defintely does save some time. I have been using this function successfully so far, please let me know your ideas if any on how to improve this piece of code further. Have fun !</p>
<br />Filed under: <a href='http://sarfraznawaz.wordpress.com/category/facebook/'>Facebook</a>, <a href='http://sarfraznawaz.wordpress.com/category/php/'>PHP</a> Tagged: <a href='http://sarfraznawaz.wordpress.com/tag/console/'>console</a>, <a href='http://sarfraznawaz.wordpress.com/tag/facebook/'>Facebook</a>, <a href='http://sarfraznawaz.wordpress.com/tag/firebug/'>firebug</a>, <a href='http://sarfraznawaz.wordpress.com/tag/php/'>PHP</a>, <a href='http://sarfraznawaz.wordpress.com/tag/speed/'>speed</a>, <a href='http://sarfraznawaz.wordpress.com/tag/tip/'>tip</a>, <a href='http://sarfraznawaz.wordpress.com/tag/trick/'>trick</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sarfraznawaz.wordpress.com/779/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sarfraznawaz.wordpress.com/779/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sarfraznawaz.wordpress.com/779/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sarfraznawaz.wordpress.com/779/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sarfraznawaz.wordpress.com/779/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sarfraznawaz.wordpress.com/779/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sarfraznawaz.wordpress.com/779/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sarfraznawaz.wordpress.com/779/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sarfraznawaz.wordpress.com/779/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sarfraznawaz.wordpress.com/779/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sarfraznawaz.wordpress.com/779/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sarfraznawaz.wordpress.com/779/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sarfraznawaz.wordpress.com/779/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sarfraznawaz.wordpress.com/779/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarfraznawaz.wordpress.com&amp;blog=7055774&amp;post=779&amp;subd=sarfraznawaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sarfraznawaz.wordpress.com/2012/01/05/outputting-php-to-browser-console/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b4af6fbcb37d41021119636bc1a2e12?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Sarfraz Ahmed</media:title>
		</media:content>

		<media:content url="http://sarfraznawaz.files.wordpress.com/2012/01/console.gif" medium="image">
			<media:title type="html">console</media:title>
		</media:content>
	</item>
		<item>
		<title>HTML5Sticky &#8211; Sticky Notes for the Web!</title>
		<link>http://sarfraznawaz.wordpress.com/2011/10/08/html5sticky-sticky-notes-for-the-web/</link>
		<comments>http://sarfraznawaz.wordpress.com/2011/10/08/html5sticky-sticky-notes-for-the-web/#comments</comments>
		<pubDate>Sat, 08 Oct 2011 13:27:03 +0000</pubDate>
		<dc:creator>Sarfraz Ahmed</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[note]]></category>
		<category><![CDATA[notes]]></category>
		<category><![CDATA[sticky]]></category>
		<category><![CDATA[stickynote]]></category>
		<category><![CDATA[stickynotes]]></category>

		<guid isPermaLink="false">http://sarfraznawaz.wordpress.com/?p=769</guid>
		<description><![CDATA[Well, yes, it has been quite a long time since I wrote the last post and that is mainly because I have been very busy at my job which didn&#8217;t allow me to write about the ideas that do come in my mind that I think I need to blog about. Today there is a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarfraznawaz.wordpress.com&amp;blog=7055774&amp;post=769&amp;subd=sarfraznawaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a><img class="alignleft size-full wp-image-770" title="HTML5Sticky" src="http://sarfraznawaz.files.wordpress.com/2011/10/html5sticky.gif?w=540" alt=""   /></a>Well, yes, it has been quite a long time since I wrote the last post and that is mainly because I have been very busy at my job which didn&#8217;t allow me to write about the ideas that do come in my mind that I think I need to blog about.</p>
<p>Today there is a lot of buzz about HTML5 because it is really cool and a lot of front-end engineers and developers are already using it despite the fact that it isn&#8217;t fully supported by all browsers &#8211; only latest standard-compliant browsers support it, IE till version 9 does not support it and that isn&#8217;t shocking because it is &#8220;IE&#8221;, however, people have made some hacky scripts such as <a href="http://code.google.com/p/html5shiv/" target="_blank"><strong>HTML5 Shiv</strong></a> to get support of HTML5 in IE. HTML5 is formally supported in version 10 of IE though. For more information about the supported features in each browser, you should head over to:</p>
<p><a href="http://caniuse.com/" target="_blank"><strong>When can I use&#8230;</strong></a></p>
<p>I have recently created a useful application using HTML5 and jQuery named HTML5Sticky. The HTML5Sticky is as the name suggests, HTML5 application you can use to create sticky notes. The sticky notes are persistent in nature meaning your created sticky notes will be there the next time you open up the app. The app uses HTML5&#8242;s <strong>localStorage</strong> feature in order to store the sticky notes.. In short, it is sticky notes for web !</p>
<p><strong>Here are its features:</strong></p>
<ul>
<li>Add text and lists with basic HTML tags</li>
<li>Multiple colors</li>
<li>Customize Width and Height</li>
<li>Customize Allowable HTML tags</li>
<li>Real sticky notes look</li>
<li>Nice hand-writing-like font</li>
</ul>
<p><strong><a href="https://github.com/sarfraznawaz2005/HTML5Sticky" target="_blank">You can view/download/fork the source code at github here.</a></strong></p>
<p><strong><a href="http://sarfraznawaz2005.kodingen.com/html5sticky/" target="_blank">And here is the demo.</a></strong></p>
<p><strong><a href="http://dailyjs.com/2011/08/19/learning-threejs-fly-sticky/" target="_blank">HTML5Sticky featured on famous DailyJS.</a></strong></p>
<br />Filed under: <a href='http://sarfraznawaz.wordpress.com/category/html5/'>HTML5</a>, <a href='http://sarfraznawaz.wordpress.com/category/jquery/'>JQuery</a> Tagged: <a href='http://sarfraznawaz.wordpress.com/tag/html5-2/'>html5</a>, <a href='http://sarfraznawaz.wordpress.com/tag/jquery/'>JQuery</a>, <a href='http://sarfraznawaz.wordpress.com/tag/note/'>note</a>, <a href='http://sarfraznawaz.wordpress.com/tag/notes/'>notes</a>, <a href='http://sarfraznawaz.wordpress.com/tag/sticky/'>sticky</a>, <a href='http://sarfraznawaz.wordpress.com/tag/stickynote/'>stickynote</a>, <a href='http://sarfraznawaz.wordpress.com/tag/stickynotes/'>stickynotes</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sarfraznawaz.wordpress.com/769/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sarfraznawaz.wordpress.com/769/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sarfraznawaz.wordpress.com/769/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sarfraznawaz.wordpress.com/769/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sarfraznawaz.wordpress.com/769/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sarfraznawaz.wordpress.com/769/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sarfraznawaz.wordpress.com/769/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sarfraznawaz.wordpress.com/769/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sarfraznawaz.wordpress.com/769/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sarfraznawaz.wordpress.com/769/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sarfraznawaz.wordpress.com/769/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sarfraznawaz.wordpress.com/769/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sarfraznawaz.wordpress.com/769/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sarfraznawaz.wordpress.com/769/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarfraznawaz.wordpress.com&amp;blog=7055774&amp;post=769&amp;subd=sarfraznawaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sarfraznawaz.wordpress.com/2011/10/08/html5sticky-sticky-notes-for-the-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b4af6fbcb37d41021119636bc1a2e12?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Sarfraz Ahmed</media:title>
		</media:content>

		<media:content url="http://sarfraznawaz.files.wordpress.com/2011/10/html5sticky.gif" medium="image">
			<media:title type="html">HTML5Sticky</media:title>
		</media:content>
	</item>
		<item>
		<title>Vertical Text with CSS</title>
		<link>http://sarfraznawaz.wordpress.com/2011/01/02/vertical-text-with-css/</link>
		<comments>http://sarfraznawaz.wordpress.com/2011/01/02/vertical-text-with-css/#comments</comments>
		<pubDate>Sun, 02 Jan 2011 17:45:08 +0000</pubDate>
		<dc:creator>Sarfraz Ahmed</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css2]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[vertical]]></category>
		<category><![CDATA[vertical text]]></category>

		<guid isPermaLink="false">http://sarfraznawaz.wordpress.com/?p=755</guid>
		<description><![CDATA[First of all, I wish you a very happy new year, a year that brings a lot of happy moments to your life and makes you prosperous in all respects. For the first post of new year, I will discuss on how to create vertical text with CSS (the post doesn&#8217;t necessarily discuss something new [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarfraznawaz.wordpress.com&amp;blog=7055774&amp;post=755&amp;subd=sarfraznawaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://sarfraznawaz.files.wordpress.com/2011/01/vertical_text.gif"><img class="alignleft size-full wp-image-757" title="vertical_text" src="http://sarfraznawaz.files.wordpress.com/2011/01/vertical_text.gif?w=540" alt=""   /></a></p>
<p>First of all, I wish you a very happy new year, a year that brings a lot of happy moments to your life and makes you prosperous in all respects.</p>
<p>For the first post of new year, I will discuss on how to create vertical text with CSS (the post doesn&#8217;t necessarily discuss something new like a new year ! ) that  works in all browsers including IE6.  You might have seen the solution  to this problem in terms of images or even javascript  but let&#8217;s see how  we can achieve the same effect with just CSS or CSS2. Before we move any  further, you might want to check out the simple demo first:</p>
<p><a href="http://sarfraznawaz2005.kodingen.com/demos/css/vertical_text.html" target="_blank"><strong>Demo 1: Vertical Text With CSS</strong></a></p>
<p>After seeing the demo above, you might have already guessed the trick. Anyways, the trick is that you should apply a <strong>width</strong> of <strong>1em</strong> and <strong>text-transform</strong> set to <strong>uppercase</strong> to the element you want to make the text of vertical something like this:</p>
<p><pre class="brush: css;">
 width:1em;
 text-transform:uppercase;
 </pre></p>
<p>There is one more step. The text that you want to appear vertically should be separated by an space or more specifically <strong>each letter</strong> should be separated by an space character, that is exactly where a width of <strong>1em</strong> plays. Here is an example:</p>
<p>H E L L O</p>
<p>Now you might have seen the vertical text often on blogs posts (or  other places) where the date information is shown vertically. I have  also created a demo page you can check out:</p>
<p><a href="http://sarfraznawaz2005.kodingen.com/demos/css/vertical_text2.html" target="_blank"><strong>Demo 2: Vertical Text With CSS</strong></a></p>
<p>So that is all there is to creating vertical text with CSS. I hope you came to know about something useful<strong>.<br />
</strong></p>
<br />Filed under: <a href='http://sarfraznawaz.wordpress.com/category/css/'>CSS</a> Tagged: <a href='http://sarfraznawaz.wordpress.com/tag/css/'>CSS</a>, <a href='http://sarfraznawaz.wordpress.com/tag/css2/'>css2</a>, <a href='http://sarfraznawaz.wordpress.com/tag/html/'>html</a>, <a href='http://sarfraznawaz.wordpress.com/tag/vertical/'>vertical</a>, <a href='http://sarfraznawaz.wordpress.com/tag/vertical-text/'>vertical text</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sarfraznawaz.wordpress.com/755/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sarfraznawaz.wordpress.com/755/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sarfraznawaz.wordpress.com/755/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sarfraznawaz.wordpress.com/755/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sarfraznawaz.wordpress.com/755/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sarfraznawaz.wordpress.com/755/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sarfraznawaz.wordpress.com/755/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sarfraznawaz.wordpress.com/755/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sarfraznawaz.wordpress.com/755/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sarfraznawaz.wordpress.com/755/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sarfraznawaz.wordpress.com/755/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sarfraznawaz.wordpress.com/755/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sarfraznawaz.wordpress.com/755/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sarfraznawaz.wordpress.com/755/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarfraznawaz.wordpress.com&amp;blog=7055774&amp;post=755&amp;subd=sarfraznawaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sarfraznawaz.wordpress.com/2011/01/02/vertical-text-with-css/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b4af6fbcb37d41021119636bc1a2e12?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Sarfraz Ahmed</media:title>
		</media:content>

		<media:content url="http://sarfraznawaz.files.wordpress.com/2011/01/vertical_text.gif" medium="image">
			<media:title type="html">vertical_text</media:title>
		</media:content>
	</item>
		<item>
		<title>Rotate and Fly off elements with jQuery and CSS3</title>
		<link>http://sarfraznawaz.wordpress.com/2010/12/27/rotate-and-fly-off-elements-with-jquery-and-css3/</link>
		<comments>http://sarfraznawaz.wordpress.com/2010/12/27/rotate-and-fly-off-elements-with-jquery-and-css3/#comments</comments>
		<pubDate>Mon, 27 Dec 2010 09:58:45 +0000</pubDate>
		<dc:creator>Sarfraz Ahmed</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[fly off]]></category>
		<category><![CDATA[rotate]]></category>
		<category><![CDATA[rotation]]></category>

		<guid isPermaLink="false">http://sarfraznawaz.wordpress.com/?p=742</guid>
		<description><![CDATA[In this post, we will look at how we can use CSS3&#8242;s property transform and other vendor-specific properties to rotate elements and finally fly them off the page with jQuery. We will also use setInterval function of javascript for the continuous animation or rotation of the elements. So let&#8217;s get started with it. Rotating Elements [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarfraznawaz.wordpress.com&amp;blog=7055774&amp;post=742&amp;subd=sarfraznawaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://sarfraznawaz.files.wordpress.com/2010/12/flyoff.gif"><img class="alignleft size-full wp-image-743" title="flyoff" src="http://sarfraznawaz.files.wordpress.com/2010/12/flyoff.gif?w=540" alt=""   /></a>In this post, we will look at how we can use CSS3&#8242;s property <strong>transform </strong>and other vendor-specific properties to rotate elements and finally fly them off the page with jQuery. We will also use <strong>setInterval</strong> function of javascript for the continuous animation or rotation of the elements. So let&#8217;s get started with it.</p>
<h2>Rotating Elements</h2>
<p>To transform/rotate elements, there is a CSS3 property <strong>transform</strong>, here is the syntax of it:</p>
<p><pre class="brush: css;">
transform: rotate(Xdeg)
</pre></p>
<p>Where X can be any number denoting the amount of rotation/angle. For example:</p>
<p><pre class="brush: css;">
transform: rotate(90deg)
</pre></p>
<p>Any element applied above rule, will transform to 90 degrees.</p>
<h2>Continuous Rotation</h2>
<p>To rotate elements continuously, we can use the <strong>setInterval </strong>function of javascript along with some math. Check out the demo below:</p>
<p><a href="http://sarfraznawaz2005.kodingen.com/demos/jquery/jquery_rotating_elements/rotate.html" target="_blank"><strong>Rotating Elements with jQuery &amp; CSS3</strong></a></p>
<p>The code of interest for the rotation is as follows:</p>
<p><pre class="brush: jscript;">
$('.rotate').click(function(){
	var interval = null;
	var counter = 0;
	var $this = $(this);
	clearInterval(interval);

	interval = setInterval(function(){
		if (counter != -360) {
			counter -= 1;
			$this.css({
				MozTransform: 'rotate(-' + -counter + 'deg)',
				WebkitTransform: 'rotate(' + -counter + 'deg)',
				transform: 'rotate(' + -counter + 'deg)'
			});
		}
	}, 10);
});
</pre></p>
<p>Here I assume you know the basics of jQuery like ready handler, class and id selectors, etc. I have explained those things in my other posts, so I won&#8217;t be discussing them but instead I will concentrate on the part of the code which is responsible for the rotation.</p>
<p>First of all, we assign a click handler to each element with the class of <strong>rotate</strong>. Later we create the necessary variables including <strong>$this</strong> equalized to <strong>$(this)</strong> meaning the <strong>current </strong>clicked element, this is useful because we will reference this variable later in the <strong>setInterval </strong>function. As an element gets clicked, we also stop the current animation or clear the time interval using <strong>clearInterval</strong> function.</p>
<p>Later inside <strong>setInterval </strong>function, we decrement the variable <strong>counter </strong>by one with each 10th Milli-second passed (the second argument specified to the <strong>setInterval </strong>function). I have specified lesser time so that animation is little faster. The reason why I decrement the value of <strong>counter </strong>is that I wanted to rotate the elements in anti-clock-wise direction. This variable keeps on decreasing until it reaches <strong>-360 </strong>specified above in the <strong>if </strong>condition meaning that our element has rotated completely and has come back to its original place.</p>
<p>Now since we have put <strong>transform </strong>CSS3 property in the <strong>setInterval </strong>function and <strong>$this</strong> refers to current clicked element, the element starts rotating with continuous animation because <strong>counter </strong>variable has been specified as the degree of rotation:</p>
<p><pre class="brush: jscript;">
transform: 'rotate(' + -counter + 'deg)'
</pre></p>
<p>Note that <strong>MozTransform </strong>and <strong>WebkitTransform </strong>are vendor-specfic CSS3 properties of Mozilla and Webkit (Chrome and Safari) browsers.</p>
<p>I have also created javascript version of rotating elements which can be seen here:</p>
<p><strong><a href="http://sarfraznawaz2005.kodingen.com/demos/dhtml/rotating_elements/" target="_blank">Rotating Elements with JavaScript &amp; CSS3</a></strong></p>
<p>So that is all there to rotating the elements in continuous fashion. Next we will see how with slight modification we can fly the elements off the page.</p>
<h2>Flying Elements Off the Page</h2>
<p>To fly elements off the page, we use jQuery&#8217;s <strong>animate </strong>method like this:</p>
<p><pre class="brush: jscript;">
animate({left: '+=' + counter + 'px'}, 40);
</pre></p>
<p>That one single line is needed to fly off elements off the page, we add this line to our previous code just after we applied CSS3 properties like this:</p>
<p><pre class="brush: jscript;">
$('.rotate').click(function(){
	var interval = null;
	var counter = 0;
	var $this = $(this);
	clearInterval(interval);

	interval = setInterval(function(){
		if (counter != -360) {
			counter -= 1;
			$this.css({
				MozTransform: 'rotate(-' + -counter + 'deg)',
				WebkitTransform: 'rotate(' + -counter + 'deg)',
				transform: 'rotate(' + -counter + 'deg)'
			}).animate({left: '+=' + counter + 'px'}, 40);
		}
	}, 10);
});
</pre></p>
<p>It is time to check out the demo:</p>
<p><a href="http://sarfraznawaz2005.kodingen.com/demos/jquery/jquery_rotating_elements/" target="_blank"><strong>Fly Off Elements with jQuery &amp; CSS3</strong></a></p>
<p>Here, we have basically specified <strong>left</strong> property of CSS to the <strong>animate </strong>method so that elements flies away to the left. You could also specify <strong>top</strong> to fly elements away to to the top. In fact, you could specify many other CSS properties to <strong>animate</strong> method such as <strong>width, height, margin</strong>, etc. Generally, you can specify any CSS property to <strong>animate </strong>method that can be specified in pixels values or in other words that could be increased or decreased.</p>
<p>Now that we have seen how to rotate elements and fly them off, it is up to you how you can take the idea and use in your cases. I suspect there could be  quite some ways we can use this technique effectively. I might come up with something fancy in my future posts while using this technique. As a last example, here is one idea to delete elements while flying them off the page:</p>
<p><a href="http://sarfraznawaz2005.kodingen.com/demos/jquery/jquery_rotating_elements/test.html" target="_blank"><strong>Deleting Elements while Flying them off the Page</strong></a></p>
<h2>Browser Compatibility</h2>
<p>The <strong>transform </strong>property works in all modern and standard-compliant browsers. It does not however work in IE, however there exist alternative when it comes to IE which is using IE-specific transformation <strong>filters </strong>you might want to consider for the rotation purpose. Here is IE-specific example:</p>
<p><pre class="brush: css;">
#myElement {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
}
</pre></p>
<p>The value for the rotation can be either 1, 2, 3, or 4. Those numbers represent 90, 180, 270, or 360 degrees of rotation respectively.</p>
<p>There also exists <a href="http://www.useragentman.com/blog/csssandpaper-a-css3-javascript-library/" target="_blank"><strong>cssSandpaper</strong></a>, the CSS3 Javascript library comes in handy when you want transformations to work across all browsers.</p>
<p>I hope you came to know about something useful you can put to use in your own ways.</p>
<br />Filed under: <a href='http://sarfraznawaz.wordpress.com/category/css/'>CSS</a>, <a href='http://sarfraznawaz.wordpress.com/category/javascript/'>Javascript</a>, <a href='http://sarfraznawaz.wordpress.com/category/jquery/'>JQuery</a> Tagged: <a href='http://sarfraznawaz.wordpress.com/tag/css/'>CSS</a>, <a href='http://sarfraznawaz.wordpress.com/tag/css3/'>css3</a>, <a href='http://sarfraznawaz.wordpress.com/tag/fly-off/'>fly off</a>, <a href='http://sarfraznawaz.wordpress.com/tag/javascript/'>Javascript</a>, <a href='http://sarfraznawaz.wordpress.com/tag/jquery/'>JQuery</a>, <a href='http://sarfraznawaz.wordpress.com/tag/rotate/'>rotate</a>, <a href='http://sarfraznawaz.wordpress.com/tag/rotation/'>rotation</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sarfraznawaz.wordpress.com/742/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sarfraznawaz.wordpress.com/742/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sarfraznawaz.wordpress.com/742/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sarfraznawaz.wordpress.com/742/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sarfraznawaz.wordpress.com/742/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sarfraznawaz.wordpress.com/742/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sarfraznawaz.wordpress.com/742/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sarfraznawaz.wordpress.com/742/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sarfraznawaz.wordpress.com/742/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sarfraznawaz.wordpress.com/742/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sarfraznawaz.wordpress.com/742/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sarfraznawaz.wordpress.com/742/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sarfraznawaz.wordpress.com/742/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sarfraznawaz.wordpress.com/742/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarfraznawaz.wordpress.com&amp;blog=7055774&amp;post=742&amp;subd=sarfraznawaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sarfraznawaz.wordpress.com/2010/12/27/rotate-and-fly-off-elements-with-jquery-and-css3/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b4af6fbcb37d41021119636bc1a2e12?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Sarfraz Ahmed</media:title>
		</media:content>

		<media:content url="http://sarfraznawaz.files.wordpress.com/2010/12/flyoff.gif" medium="image">
			<media:title type="html">flyoff</media:title>
		</media:content>
	</item>
		<item>
		<title>Custom Facebook Connect Image</title>
		<link>http://sarfraznawaz.wordpress.com/2010/12/11/custom-facebook-connect-image/</link>
		<comments>http://sarfraznawaz.wordpress.com/2010/12/11/custom-facebook-connect-image/#comments</comments>
		<pubDate>Sat, 11 Dec 2010 12:13:14 +0000</pubDate>
		<dc:creator>Sarfraz Ahmed</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[connect]]></category>
		<category><![CDATA[image]]></category>

		<guid isPermaLink="false">http://sarfraznawaz.wordpress.com/?p=726</guid>
		<description><![CDATA[One of the ways you can put facebook connect button on your site is to use &#60;fb:login-button&#62; fbml tag something like this: That will show default facebook button with a rather small image. You can make the button little larger by specifying length and size attributes like this: However, the requirement in my case was [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarfraznawaz.wordpress.com&amp;blog=7055774&amp;post=726&amp;subd=sarfraznawaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of the ways you can put facebook connect button on your site is to use <strong>&lt;fb:login-button&gt;</strong> fbml tag something like this:</p>
<p><pre class="brush: xml;">
  &lt;fb:login-button onlogin=&quot;window.location='www.example.com'&quot;&gt;&lt;/fb:login-button&gt;
</pre></p>
<p>That will show default facebook button with a rather small image. You can make the button little larger by specifying <strong>length</strong> and <strong>size</strong> attributes like this:</p>
<p><pre class="brush: xml;">
  &lt;fb:login-button onlogin=&quot;window.location='www.example.com'&quot; length=&quot;long&quot; size=&quot;large&quot;&gt;&lt;/fb:login-button&gt;
</pre></p>
<p>However, the requirement in my case was that the button should be even bigger. I searched through the facebook connect docs and elsewhere but did not find a way to customize the facebook connect image (it is rendered directly by facebook; let me know if there is a way via comments please). I thought why I can&#8217;t force the facebook connect button to use the image that I specify. I fired up firebug (the addon of firefox) and this is what it showed for the <strong>&lt;fb:login-button&gt;</strong> fbml tag:</p>
<p><a href="http://sarfraznawaz.files.wordpress.com/2010/12/fb_fbconnect.gif"><img class="aligncenter size-full wp-image-728" title="fb_fbconnect" src="http://sarfraznawaz.files.wordpress.com/2010/12/fb_fbconnect.gif?w=540" alt=""   /></a></p>
<p>As can be seen, facebook automatically applies <strong>FB_login_button</strong> class amongst others to the connect button. As you can see, there is an <strong>img</strong> tag inside, that was all I needed to get my own image for the connect button. The idea is to find the image inside connect button and replace with your own once DOM has loaded. Now you get the idea, I wrote this jQuery code to get custom image for the connect button:</p>
<p><pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot;&gt;
$(function(){
  // overwrite the fb connect image - let's force it !!
  $('.FB_login_button').find('img').attr('src', 'img/my-custom-image.png');
});
&lt;/script&gt;
</pre></p>
<p>We use the selector <strong>.FB_login_button</strong> and then use <strong>find </strong>method to find the image inside element (&lt;<strong>fb:login-button</strong>&gt;) having that class and replace its <strong>src </strong>attribute with the path of our custom image.  Since we have wrapped our code in <strong>ready </strong>handler <strong>$(function(){&#8230;})</strong>, our code will execute as soon as DOM becomes ready and when you visit the page, it will have your own custom facebook connect button image.</p>
<p>I also noticed that there was a link tag generated with the class of <strong>fbconnect_login_button</strong>. We could use that just as well like this:</p>
<p><pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot;&gt;
$(function(){
  // overwrite the fb connect image - let's force it !!
  $('.fbconnect_login_button').find('img').attr('src', 'img/my-custom-image.png');
});
&lt;/script&gt;
</pre></p>
<p>Now this is good as long as you are using jQuery on the page where facebook connect button exists. But if you are not using jQuery, you can do the same thing with vanilla javascript albeit with little more code. Here is how you can do the same thing with vanilla javascript:</p>
<p><pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot;&gt;
window.onload = function(){
  var ourImg = null; // this will store the facebook connect img tag

  // find all the links on the current page
  var links = document.getElementsByTagName('a');

  // loop over all the links
  for(var i = 0; i &lt; links.length; i++){
    // get class of this link
    var cls = links[i].className;

    // check to see if this is the link with specified class
    if (cls === 'fbconnect_login_button'){
      ourImg = links[i].firstChild; // which is img tag we need
      break;  // done, let's get the hell out of here
    }
  }

  // finally replace with our own image !
  ourImg.src = '&lt;?php echo base_url() ?&gt;images/fb.png';
};
&lt;/script&gt;
</pre></p>
<p>Ops ! that is a lot of code I have written compared to jQuery&#8217;s but that&#8217;s what you need if you are not using jQuery on your page. Note that this time, we are using <strong>load </strong>event of the window <strong>window.onload = function(){&#8230;}</strong> which will fire when all the page resources are loaded including images, frames and the DOM unlike ready handler of jQuery which fires as soon as DOM becomes ready and runs before images, frames or any other external resources loaded into the page.</p>
<p>Finally, this is the page that now uses custom facebook connect button image while using <strong>&lt;fb:login-button&gt;</strong> fbml tag:</p>
<p><a href="http://aplifylabs.com/cutiespring/login/" target="_blank"><strong>View the Page</strong></a></p>
<br />Filed under: <a href='http://sarfraznawaz.wordpress.com/category/facebook/'>Facebook</a>, <a href='http://sarfraznawaz.wordpress.com/category/javascript/'>Javascript</a>, <a href='http://sarfraznawaz.wordpress.com/category/jquery/'>JQuery</a> Tagged: <a href='http://sarfraznawaz.wordpress.com/tag/button/'>button</a>, <a href='http://sarfraznawaz.wordpress.com/tag/connect/'>connect</a>, <a href='http://sarfraznawaz.wordpress.com/tag/facebook/'>Facebook</a>, <a href='http://sarfraznawaz.wordpress.com/tag/image/'>image</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sarfraznawaz.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sarfraznawaz.wordpress.com/726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sarfraznawaz.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sarfraznawaz.wordpress.com/726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sarfraznawaz.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sarfraznawaz.wordpress.com/726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sarfraznawaz.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sarfraznawaz.wordpress.com/726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sarfraznawaz.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sarfraznawaz.wordpress.com/726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sarfraznawaz.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sarfraznawaz.wordpress.com/726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sarfraznawaz.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sarfraznawaz.wordpress.com/726/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarfraznawaz.wordpress.com&amp;blog=7055774&amp;post=726&amp;subd=sarfraznawaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sarfraznawaz.wordpress.com/2010/12/11/custom-facebook-connect-image/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b4af6fbcb37d41021119636bc1a2e12?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Sarfraz Ahmed</media:title>
		</media:content>

		<media:content url="http://sarfraznawaz.files.wordpress.com/2010/12/fb_fbconnect.gif" medium="image">
			<media:title type="html">fb_fbconnect</media:title>
		</media:content>
	</item>
		<item>
		<title>Flag of Pakistan with pure CSS</title>
		<link>http://sarfraznawaz.wordpress.com/2010/11/27/flag-of-pakistan-with-pure-css/</link>
		<comments>http://sarfraznawaz.wordpress.com/2010/11/27/flag-of-pakistan-with-pure-css/#comments</comments>
		<pubDate>Sat, 27 Nov 2010 12:15:53 +0000</pubDate>
		<dc:creator>Sarfraz Ahmed</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[flag]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Pakistan]]></category>

		<guid isPermaLink="false">http://sarfraznawaz.wordpress.com/?p=711</guid>
		<description><![CDATA[With no much work on the first day in new company I have joined, a sudden thought of creating Pakistan&#8217;s flag with pure CSS came into my mind. So I started off with that and came up with the desired result using CSS only. See the Flag of Pakistan Creating orange stick, white and green [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarfraznawaz.wordpress.com&amp;blog=7055774&amp;post=711&amp;subd=sarfraznawaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://sarfraznawaz.files.wordpress.com/2010/11/pak_flag_with_css.gif"><img class="alignleft size-full wp-image-712" title="pak_flag_with_css" src="http://sarfraznawaz.files.wordpress.com/2010/11/pak_flag_with_css.gif?w=540" alt=""   /></a>With no much work on the first day in new company I have joined, a sudden thought of creating Pakistan&#8217;s flag with pure CSS came into my mind. So I started off with that and came up with the desired result using CSS only.</p>
<p><a title="Flag of Pakistan with pure CSS" href="http://sarfraznawaz2005.kodingen.com/demos/css/pak_flag/" target="_blank">See the Flag of Pakistan</a></p>
<p>Creating orange stick, white and green rectangles with specified background color was easiest part. As for moon, naturally I used the <a href="http://www.css3.info/preview/rounded-border/" target="_blank">border-radius</a> CSS3 property. Basically I created two divs with border-radius value set to 90px to create perfect round shape (360/4 = 90). I gave the background color of white and green to these divs and used absolute positioning and z-index to put green round shape over the white round shape but at little distance so that the white div looks like a moon. I would suggest you to know this very useful  CSS trick, something I knew about and used throughout the creation of the flag.</p>
<p><a href="http://css-tricks.com/absolute-positioning-inside-relative-positioning/" target="_blank">Absolute Positioning Inside Relative Positioning</a></p>
<p>You know CSS3 isn&#8217;t supported in IE&lt;=8, so I used <a href="http://css3pie.com/" target="_blank">CSS3Pie</a> to get the support for border-radius CSS3 property in IE including IE6.﻿</p>
<p>The trickiest part was creating the star shape but then again once you know how to create <a href="http://www.dinnermint.org/blog/css/creating-triangles-in-css/" target="_blank">CSS triangles</a>﻿, things become easier. To get the star working correctly in buggy as always IE, I used the﻿<a href="http://www.quirksmode.org/css/condcom.html" target="_blank"> CSS conditional comments</a>﻿. The star looks slightly bigger in IE but still not bad the effort.</p>
<p>The flag was tested working fine in FF 3.6, IE 6 and above, Chrome and Safari.</p>
<p><a href="http://sarfraznawaz2005.kodingen.com/demos/css/pak_flag/pak_flag.zip">Download Source</a></p>
<p>&nbsp;</p>
<br />Filed under: <a href='http://sarfraznawaz.wordpress.com/category/css/'>CSS</a> Tagged: <a href='http://sarfraznawaz.wordpress.com/tag/css/'>CSS</a>, <a href='http://sarfraznawaz.wordpress.com/tag/css3/'>css3</a>, <a href='http://sarfraznawaz.wordpress.com/tag/flag/'>flag</a>, <a href='http://sarfraznawaz.wordpress.com/tag/html/'>html</a>, <a href='http://sarfraznawaz.wordpress.com/tag/pakistan/'>Pakistan</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sarfraznawaz.wordpress.com/711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sarfraznawaz.wordpress.com/711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sarfraznawaz.wordpress.com/711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sarfraznawaz.wordpress.com/711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sarfraznawaz.wordpress.com/711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sarfraznawaz.wordpress.com/711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sarfraznawaz.wordpress.com/711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sarfraznawaz.wordpress.com/711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sarfraznawaz.wordpress.com/711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sarfraznawaz.wordpress.com/711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sarfraznawaz.wordpress.com/711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sarfraznawaz.wordpress.com/711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sarfraznawaz.wordpress.com/711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sarfraznawaz.wordpress.com/711/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarfraznawaz.wordpress.com&amp;blog=7055774&amp;post=711&amp;subd=sarfraznawaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sarfraznawaz.wordpress.com/2010/11/27/flag-of-pakistan-with-pure-css/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b4af6fbcb37d41021119636bc1a2e12?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Sarfraz Ahmed</media:title>
		</media:content>

		<media:content url="http://sarfraznawaz.files.wordpress.com/2010/11/pak_flag_with_css.gif" medium="image">
			<media:title type="html">pak_flag_with_css</media:title>
		</media:content>
	</item>
		<item>
		<title>jQuery Drop Shadow Plugin Revisited</title>
		<link>http://sarfraznawaz.wordpress.com/2010/10/15/drop-shadow-plugin-revisited/</link>
		<comments>http://sarfraznawaz.wordpress.com/2010/10/15/drop-shadow-plugin-revisited/#comments</comments>
		<pubDate>Thu, 14 Oct 2010 19:45:59 +0000</pubDate>
		<dc:creator>Sarfraz Ahmed</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[dropshadow]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[shadow]]></category>

		<guid isPermaLink="false">http://sarfraznawaz.wordpress.com/?p=697</guid>
		<description><![CDATA[In one of my previous posts, I had shown how to create jQuery drop shadow plugin. To create the drop shadow effect, I was basically creating a div behind the elements which were to be shadowed. I knew about CSS3 box-shadow property but I did not consider it for the drop shadow effect because CSS3 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarfraznawaz.wordpress.com&amp;blog=7055774&amp;post=697&amp;subd=sarfraznawaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" src="http://sarfraznawaz.files.wordpress.com/2010/03/dropshadow.gif?w=300&#038;h=184&#038;h=184" alt="" width="300" height="184" />In one of my <a href="http://sarfraznawaz.wordpress.com/2010/06/29/creating-drop-shadow-jquery-plugin/">previous posts</a>, I had shown how to create jQuery drop shadow plugin. To create the drop shadow effect, I was basically creating a div behind the elements which were to be shadowed. I knew about CSS3 <strong>box-shadow</strong> property but I did not consider it for the drop shadow effect because CSS3 is only supported by modern standard-compliant browsers but a comment of <a href="http://sarfraznawaz.wordpress.com/2010/06/29/creating-drop-shadow-jquery-plugin/">C-King at my previous post</a> made me rethink about it and in this post, the plugin has been modified to create the CSS3 drop shadow effect.</p>
<p>The plugin now applies CSS3 drop shadow effect for the browsers that support it or it will use div-based approach like it did before. The plugin now checks if the current browser supports CSS3 and if so, it will apply CSS3 drop shadow effect and if CSS3 is not supported, it will apply div-based drop shadow effect. A new <strong>blur</strong> option has been added into updated plugin which is only applicable if current browser supports CSS3.</p>
<p>The plugin has been checked working fine in IE6+, FF, Webkit and Opera.</p>
<h3><a href="http://sarfraznawaz2005.kodingen.com/demos/jquery/drop_shadow_plugin_updated.zip">Download Drop Shadow Plugin (Updated)</a></h3>
<br />Filed under: <a href='http://sarfraznawaz.wordpress.com/category/jquery/'>JQuery</a> Tagged: <a href='http://sarfraznawaz.wordpress.com/tag/dropshadow/'>dropshadow</a>, <a href='http://sarfraznawaz.wordpress.com/tag/jquery/'>JQuery</a>, <a href='http://sarfraznawaz.wordpress.com/tag/plugin/'>plugin</a>, <a href='http://sarfraznawaz.wordpress.com/tag/shadow/'>shadow</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sarfraznawaz.wordpress.com/697/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sarfraznawaz.wordpress.com/697/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sarfraznawaz.wordpress.com/697/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sarfraznawaz.wordpress.com/697/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sarfraznawaz.wordpress.com/697/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sarfraznawaz.wordpress.com/697/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sarfraznawaz.wordpress.com/697/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sarfraznawaz.wordpress.com/697/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sarfraznawaz.wordpress.com/697/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sarfraznawaz.wordpress.com/697/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sarfraznawaz.wordpress.com/697/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sarfraznawaz.wordpress.com/697/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sarfraznawaz.wordpress.com/697/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sarfraznawaz.wordpress.com/697/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarfraznawaz.wordpress.com&amp;blog=7055774&amp;post=697&amp;subd=sarfraznawaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sarfraznawaz.wordpress.com/2010/10/15/drop-shadow-plugin-revisited/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b4af6fbcb37d41021119636bc1a2e12?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Sarfraz Ahmed</media:title>
		</media:content>

		<media:content url="http://sarfraznawaz.files.wordpress.com/2010/03/dropshadow.gif?w=300&#38;h=184" medium="image" />
	</item>
		<item>
		<title>StyleTable jQuery Plugin</title>
		<link>http://sarfraznawaz.wordpress.com/2010/09/19/styletable-jquery-plugin/</link>
		<comments>http://sarfraznawaz.wordpress.com/2010/09/19/styletable-jquery-plugin/#comments</comments>
		<pubDate>Sun, 19 Sep 2010 14:04:39 +0000</pubDate>
		<dc:creator>Sarfraz Ahmed</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[style]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://sarfraznawaz.wordpress.com/?p=684</guid>
		<description><![CDATA[While working on a project few days back, I came upon a requirement to make html tables look pretty and for that I created a function in jQuery to style a table by calling that function on a given table. Later I thought of converting that function into more usable piece of code &#8211; a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarfraznawaz.wordpress.com&amp;blog=7055774&amp;post=684&amp;subd=sarfraznawaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://sarfraznawaz.files.wordpress.com/2010/09/styletable.gif"><img class="alignleft size-full wp-image-685" title="styletable" src="http://sarfraznawaz.files.wordpress.com/2010/09/styletable.gif?w=540" alt=""   /></a>While working on a project few days back, I came upon a requirement to make html tables look pretty and for that I created a function in jQuery to style a table by calling that function on a given table. Later I thought of converting that function into more usable piece of code &#8211; a jQuery plugin and I introduce the <strong>StyleTable</strong> jQuery plugin.</p>
<p><span style="color:#008000;">.</span></p>
<p><span style="color:#008000;">.</span></p>
<p><span style="color:#008000;">.</span></p>
<p>Using the plugin is as  simple as this one line of code:</p>
<p><pre class="brush: jscript;">
  $('table').styleTable();
</pre></p>
<p>Off course,  you can also apply the StyleTable plugin based on table classes or ids or even their attributes. See the plugin documentation for more information and examples.</p>
<p><a href="http://sarfraznawaz2005.kodingen.com/demos/jquery/styletable/" target="_blank">See the plugin in action along with documentation</a></p>
<p><a href="http://sarfraznawaz2005.kodingen.com/demos/jquery/styletable/table_style_plugin.zip" target="_blank">Download TableStyle Plugin With  Examples</a></p>
<p><span style="color:#000000;">.</span></p>
<br />Filed under: <a href='http://sarfraznawaz.wordpress.com/category/jquery/'>JQuery</a> Tagged: <a href='http://sarfraznawaz.wordpress.com/tag/html/'>html</a>, <a href='http://sarfraznawaz.wordpress.com/tag/jquery/'>JQuery</a>, <a href='http://sarfraznawaz.wordpress.com/tag/style/'>style</a>, <a href='http://sarfraznawaz.wordpress.com/tag/table/'>table</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sarfraznawaz.wordpress.com/684/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sarfraznawaz.wordpress.com/684/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sarfraznawaz.wordpress.com/684/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sarfraznawaz.wordpress.com/684/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sarfraznawaz.wordpress.com/684/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sarfraznawaz.wordpress.com/684/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sarfraznawaz.wordpress.com/684/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sarfraznawaz.wordpress.com/684/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sarfraznawaz.wordpress.com/684/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sarfraznawaz.wordpress.com/684/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sarfraznawaz.wordpress.com/684/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sarfraznawaz.wordpress.com/684/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sarfraznawaz.wordpress.com/684/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sarfraznawaz.wordpress.com/684/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarfraznawaz.wordpress.com&amp;blog=7055774&amp;post=684&amp;subd=sarfraznawaz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sarfraznawaz.wordpress.com/2010/09/19/styletable-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b4af6fbcb37d41021119636bc1a2e12?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Sarfraz Ahmed</media:title>
		</media:content>

		<media:content url="http://sarfraznawaz.files.wordpress.com/2010/09/styletable.gif" medium="image">
			<media:title type="html">styletable</media:title>
		</media:content>
	</item>
	</channel>
</rss>
