
<?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>Rohit Singh Sengar</title>
	<atom:link href="http://rohitsengar.cueblocks.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://rohitsengar.cueblocks.net</link>
	<description>Passionate for Programming</description>
	<lastBuildDate>Thu, 27 May 2010 12:06:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>jQuery Tag Cloud Plugin</title>
		<link>http://rohitsengar.cueblocks.net/jquery-tag-cloud-plugin/</link>
		<comments>http://rohitsengar.cueblocks.net/jquery-tag-cloud-plugin/#comments</comments>
		<pubDate>Thu, 27 May 2010 10:53:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Freebies]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[customize]]></category>
		<category><![CDATA[easing]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[simple]]></category>
		<category><![CDATA[Tag Cloud]]></category>
		<category><![CDATA[tags]]></category>

		<guid isPermaLink="false">http://rohitsengar.cueblocks.net/?p=204</guid>
		<description><![CDATA[See Online Demo This plugin will create a animated tag cloud out of the list of tags for your blog/site. It is based upon the jQuery framework. Although there are many tag cloud available in jQuery Plugin arsenal, I really felt the need to create this one. The plugin include font animation as well as [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Frohitsengar.cueblocks.net%2Fjquery-tag-cloud-plugin%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Frohitsengar.cueblocks.net%2Fjquery-tag-cloud-plugin%2F&amp;source=rohitsengar&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<blockquote>
<p style="text-align: center;"><a title="Click to see Tag Cloud Demo" href="http://rohitsengar.cueblocks.net/tag-cloud/" target="_blank">See Online Demo</a></p>
</blockquote>
<p>This plugin will create a animated tag cloud out of the list of tags for your blog/site. It is based upon the jQuery framework. Although there are many tag cloud available in jQuery Plugin arsenal, I really felt the need to create this one. The plugin include font animation as well as tag animation in three ways (horizontal, vertical and random). The animation will stop when user mouse over on the tag cloud, restarts after sometime after mouse out. Very easy to implement and customize. You just need to write a simple line apply it on the &lt;div&gt; or &lt;ul&gt; containing list of tags.</p>
<blockquote>
<p style="text-align: center;">See <a title="Online demo" href="http://rohitsengar.cueblocks.net/tag-cloud/" target="_blank">online demo</a> | <a title="Download jQuery Tag Cloud Plugin" href="http://rohitsengar.cueblocks.net/tag-cloud/download.php?f=jquery.tagcloud.min.js" target="_blank">Download Tag Cloud Plugin</a></p>
</blockquote>
<div class="wp-caption aligncenter" style="width: 559px"><a href="http://rohitsengar.cueblocks.net/tag-cloud/"><img title="jQuery Tag Cloud Plugin" src="http://rohitsengar.cueblocks.net/tag-cloud/ScreenShot.png" alt="jQuery Tag Cloud Plugin" width="549" height="409" /></a><p class="wp-caption-text">ScreenShot jQuery Tag Cloud Plugin</p></div>
<h4>Usage</h4>
<p><em><strong>Step 1:</strong></em> Style tags container. The tags container can be div, ul or anything else. But you need to define these style properties for the tags container before using the plugin &#8211; Position, Width and Height. You can style &lt;a&gt; of the tags as you wish.</p>
<p><strong><em>Step 2:</em></strong> Include latest <a title="go to jquery site" href="http://jquery.com/" target="_blank">jquery.js</a> and <a title="Download jQuery Tag Cloud Plugin" href="http://rohitsengar.cueblocks.net/tag-cloud/download.php?f=jquery.tagcloud.min.js" target="_blank">jquery.tagcloud.min.js</a> in &lt;head&gt; section of the page like following,</p>
<blockquote><p>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;jquery.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script type=&#8221;text/javascript&#8221; src=&#8221;jquery.tagcloud.min.js&#8221;&gt;&lt;/script&gt;</p></blockquote>
<p><strong><em>Step 3:</em></strong> Apply the tag cloud plugin on the tags container. like following</p>
<blockquote><p>&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
$(function(){<br />
$(&#8220;#tag-cloud&#8221;).tagCloud();<br />
});<br />
&lt;/script&gt;</p></blockquote>
<p>Instead of #tag-cloud, just give #&lt;id of the tags container&gt;</p>
<h4>Customize</h4>
<p><strong><em>Direction:</em></strong> You can choose the direction of the tags movement. There are 3 options &#8211; &#8220;vertical&#8221; (see <a title="Example 3" href="http://rohitsengar.cueblocks.net/tag-cloud/#example3" target="_blank">Example3</a>), &#8220;horizontal&#8221; (see <a title="Example 2" href="http://rohitsengar.cueblocks.net/tag-cloud/#example2" target="_blank">Example2</a>) and &#8220;random&#8221; (see <a title="Example 1" href="http://rohitsengar.cueblocks.net/tag-cloud/#example1" target="_blank">Example1</a>). The default option is &#8220;random&#8221;. You can set it as following,</p>
<blockquote><p>$(&#8220;#tag-cloud&#8221;).tagCloud({&#8220;direction&#8221;:&#8221;horizontal&#8221;});</p></blockquote>
<p>See <a title="Example 2" href="../tag-cloud/#example2" target="_blank">Example2</a> and <a title="Example 3" href="../tag-cloud/#example3" target="_blank">Example3</a>.</p>
<p><strong><em>Easein:</em></strong> You can use various kinds of easing effects provided by the <a title="Download jQuery Easing Plugin" href="http://gsgd.co.uk/sandbox/jquery/easing/jquery.easing.1.3.js" target="_blank">jquery easing plugin</a>. The list of easing effects can be found at <a title="go to jquery easing plugin" href="http://gsgd.co.uk/sandbox/jquery/easing/" target="_blank">http://gsgd.co.uk/sandbox/jquery/easing/</a> . <strong>Please Note</strong> if you want to use this option, then first include the easing plugin before applying the plugin. See <a title="Example 2" href="../tag-cloud/#example2" target="_blank">Example2</a> and <a title="Example 3" href="../tag-cloud/#example3" target="_blank">Example3</a>. You can set this option like,</p>
<blockquote><p>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;http://gsgd.co.uk/sandbox/jquery/easing/jquery.easing.1.3.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
$(function(){<br />
$(&#8220;#tag-cloud1&#8243;).tagCloud({ &#8220;easein&#8221;:&#8221;easeOutBounce&#8221;});<br />
});<br />
&lt;/script&gt;</p></blockquote>
<p><strong><em>Speed:</em></strong> You can set the speed of the tags animation in the plugin. You simply need to set the speed option parameter. It only accept numeric value like 2000 (2 seconds). Keep it more than 2000 for smooth animation. It can be set as,</p>
<blockquote><p>$(&#8220;#tag-cloud&#8221;).tagCloud({&#8220;speed&#8221;:2000});</p></blockquote>
<p><em><strong>Combination:</strong></em> You can set all the options at once like</p>
<blockquote><p>$(&#8220;#tag-cloud&#8221;).tagCloud({&#8220;direction&#8221;:&#8221;vertical&#8221;, &#8220;easein&#8221;:&#8221;easeOutBack&#8221;, &#8220;speed&#8221;:2000});</p></blockquote>
<blockquote>
<p style="text-align: center;">See <a title="Online demo" href="../tag-cloud/" target="_blank">online demo</a> | <a title="Download jQuery Tag Cloud Plugin" href="../tag-cloud/download.php?f=jquery.tagcloud.min.js" target="_blank">Download Tag Cloud Plugin</a></p>
</blockquote>
<p>As you see its pretty straight to apply it and its effects are amazing. You can have as many tag cloud on your blog/site as you wish. I tried to keep it very simple, but if you still have some doubts/difficulties in implementing it or need help, feel free to post your comments. If anyone want to extend this plugin here is its uncompressed version . Hope it will help in making your blog/site more dazzling !!!</p>
]]></content:encoded>
			<wfw:commentRss>http://rohitsengar.cueblocks.net/jquery-tag-cloud-plugin/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Analog Clock using Javascript &amp; Raphael</title>
		<link>http://rohitsengar.cueblocks.net/analog-clock-using-javascript-raphael/</link>
		<comments>http://rohitsengar.cueblocks.net/analog-clock-using-javascript-raphael/#comments</comments>
		<pubDate>Wed, 12 May 2010 06:38:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Freebies]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[analog]]></category>
		<category><![CDATA[Analog clock]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[clock]]></category>
		<category><![CDATA[customize]]></category>
		<category><![CDATA[dial]]></category>
		<category><![CDATA[raphael]]></category>
		<category><![CDATA[rotate]]></category>
		<category><![CDATA[styling]]></category>

		<guid isPermaLink="false">http://rohitsengar.cueblocks.net/?p=199</guid>
		<description><![CDATA[Click to see online demo Last weekend, I was playing with Raphaël &#8211; A JavaScript Library for drawing/graphics. Its like drawing anything on a canvas, pretty easy and impressive. In that, there was a function call rotate() which can rotate any element(line, circle, rectangle, image etc.) at any angle from a given axis. This gives [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Frohitsengar.cueblocks.net%2Fanalog-clock-using-javascript-raphael%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Frohitsengar.cueblocks.net%2Fanalog-clock-using-javascript-raphael%2F&amp;source=rohitsengar&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<blockquote>
<p style="text-align: center;"><a title="click to see demo" href="http://rohitsengar.cueblocks.net/analog-clock/" target="_blank">Click to see online demo</a></p>
</blockquote>
<p>Last weekend, I was playing with <a href="http://raphaeljs.com/">Raphaël</a> &#8211; A JavaScript Library for drawing/graphics. Its like drawing anything on a canvas, pretty easy and impressive. In that, there was a function call rotate() which can rotate any element(line, circle, rectangle, image etc.) at any angle from a given axis. This gives me an idea to have 3 lines of different color, stroke and length for second, minute and hour hand in a clock. After every second, we need to check the time with the help of javascript <strong>Date()</strong>. Then rotate the second hand line, about the center axis with [6 * number of seconds] degrees (as 1 sec is equal to 6 degrees). Rotate the minute hand line with [6 * number of minutes] degrees. Rotate the hour hand with [30 * number of hours] degrees (as 1 hour is equal to 30 degrees). Combining this logic, I built a clock (<em>with just 30 lines of code</em>), whose demo is given below,</p>
<p><iframe src="http://rohitsengar.cueblocks.net/analog-clock/frame.html" height="525" width="595" frameborder="0" style="border:1px solid #ababab;"></iframe></p>
<p>For this demo, I have used images of different dials (which I have downloaded from google) as backgound. Upon which the clock is drawn through Raphaël. Luckly, for me, the center of these dials images excatly conicides with the center for clock. Another option I provided in the demo is to change the color of second, minute and hour hand of the clock according to the dial selected by the user. It can be used anywhere with any size, styling and customization. I can also help you with that.</p>
<p>Open the demo in <a href="http://rohitsengar.cueblocks.net/analog-clock/" target="_blank">new window</a>. As this clock is based upon Raphaël (which is dependent upon CSS 3), it may not work in certain versions of different browsers. Kindly get back to in that case with browser name and version. Lastly, your feedback and suggestions are welcomed as always. Raphaël is a powerful library and you can built some really fancy stuff with it. Here is my bit, hope you guys like it.</p>
]]></content:encoded>
			<wfw:commentRss>http://rohitsengar.cueblocks.net/analog-clock-using-javascript-raphael/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Build Calendar with PHP</title>
		<link>http://rohitsengar.cueblocks.net/build-calendar-with-php/</link>
		<comments>http://rohitsengar.cueblocks.net/build-calendar-with-php/#comments</comments>
		<pubDate>Wed, 05 May 2010 13:01:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Freebies]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Calendar]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Custom]]></category>
		<category><![CDATA[simple]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://rohitsengar.cueblocks.net/?p=173</guid>
		<description><![CDATA[CLICK HERE TO SEE ONLINE DEMO For my last project I required to use calendar in PHP. I searched of it online and there were lots of them. But all of them were complicated, packed with lots of features (appointments etc.) and lacks examples. There were calendar classes but of no use. So, instead of [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Frohitsengar.cueblocks.net%2Fbuild-calendar-with-php%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Frohitsengar.cueblocks.net%2Fbuild-calendar-with-php%2F&amp;source=rohitsengar&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --></p>
<blockquote>
<p style="text-align: center;"><a title="PHP Calendar" href="http://rohitsengar.cueblocks.net/calendar" target="_blank"><strong>CLICK HERE TO SEE ONLINE DEMO</strong></a></p>
</blockquote>
<p>For my last project I required to use calendar in PHP. I searched of it online and there were lots of them. But all of them were complicated, packed with lots of features (appointments etc.) and lacks examples. There were calendar classes but of no use. So, instead of searching, I decided to create code for calendar myself in PHP. Working on logic I used for creating calendar, I didn&#8217;t find it hard to build it. On the other hand, it was way too easy to create it than it actually looks like. No doubts, I was very much helped by many date and time pre built functions provided by PHP. Hence I am providing you with the code that creates and displays calendar.  The outcome of the code is below (Apologies for my poor styling skills),</p>
<div class="wp-caption aligncenter" style="width: 585px"><a href="http://rohitsengar.cueblocks.net/calendar/"><img title="Screenshot for php calendar" src="http://rohitsengar.cueblocks.net/calendar/Screenshot.jpg" alt="Screenshot for php calendar" width="575" height="460" /></a><p class="wp-caption-text">Screenshot for php calendar</p></div>
<p>&nbsp;</p>
<p>The table head section shows the current month and year along with 2 links (Previous &amp; Next Month) for navigating to different months. Below that there are columns for various days in week. The table body section consists of 6 rows and 7 columns. The reason behind 7 columns is easy, for 7 days in a week. The logic behind 6 rows lies in the fact that even if the 1 of the month (with 31 days) starts from the last day of week, the last day won’t go beyond 2 column of 6th row. I used some CSS classes like &#8220;.holiday&#8221; for Sundays &#8220;.day&#8221; for normal days of month and no class for blank &lt;td&gt;.</p>
<p>The logic starts with two loops with outer loop running 6 times (for weeks) and inner 7 times (for week days). In first loop we will put &lt;td&gt;&amp;nbsp;&lt;/td&gt; till it encounter the 1 day of the month (variable &#8211; $skip). Both the loop will run fine till the days in that month (variable &#8211; $daysInMonth). If it’s Sunday then we will add &#8220;.holiday &#8221; class in &lt;td&gt; otherwise &#8220;. day &#8221; class along with date. The next and previous month links is formed with adding year + month as string (e.g. 201005 for May, 2010) and pass it as parameter to the page itself. The rest of the code is self-explanatory. Below is the PHP code for the calendar ( or <a title="Download Source Code" href="http://rohitsengar.cueblocks.net/calendar/download.php?f=index.php" target="_blank">DOWNLOAD CODE</a>)</p>
<blockquote style="font-style: normal;"><p>&lt;?php</p>
<p>// if ym is set, i.e. somebody clicked on next or previous months link<br />
if(isset($_GET["ym"]))<br />
{<br />
$year = (int)substr($_GET["ym"], 0, 4);<br />
$month = (int)substr($_GET["ym"], 4, 2);<br />
}<br />
else    // otherwise take current month &amp; year<br />
{<br />
$month = date(&#8220;m&#8221;, mktime(0,0,0,date(&#8216;m&#8217;),1,date(&#8216;Y&#8217;)));<br />
$year = date(&#8220;Y&#8221;, mktime(0,0,0,date(&#8216;m&#8217;),1,date(&#8216;Y&#8217;)));<br />
}</p>
<p>$skip = date(&#8220;w&#8221;, mktime(0,0,0,$month,1,$year)); // days to skip in 1 row of week.<br />
$daysInMonth = date(&#8220;t&#8221;, mktime(0,0,0,$month,1,$year));    // total number of dates in the month.<br />
$calendar_head = &#8221;;    // for calendar head<br />
$calendar_body = &#8221;;    // for calendar boday<br />
$day = 1;    // For date in calendar</p>
<p>for($i = 0; $i &lt; 6; $i++) // Outer loop for weeks<br />
{<br />
$calendar_body .= &#8216;&lt;tr&gt;&#8217;;    // start row tag<br />
for($j = 0; $j &lt; 7; $j++)    // Inner loop for week days<br />
{<br />
if(($skip &gt; 0)||($day &gt; $daysInMonth)) // display blank till 1 day of month or after total numnber of days in that month<br />
{<br />
$calendar_body .= &#8216;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&#8217;;<br />
$skip&#8211;;<br />
}<br />
else<br />
{<br />
if($j == 0)    // if its Sunday then add class holiday<br />
$calendar_body .= &#8216;&lt;td&gt;&#8217;.$day.&#8217;&lt;/td&gt;&#8217;;<br />
else    // otherwise add day class<br />
$calendar_body .= &#8216;&lt;td&gt;&#8217;.$day.&#8217;&lt;/td&gt;&#8217;;</p>
<p>$day++; // Increment $day<br />
}</p>
<p>}    // inner loop closes<br />
$calendar_body .= &#8216;&lt;/tr&gt;&#8217;; // end row tag<br />
} // outer loop closes</p>
<p>// Calendar head section<br />
$calendar_head = &#8216;<br />
&lt;tr&gt;<br />
&lt;th colspan=&#8221;2&#8243;&gt;&lt;a href=&#8221;?ym=&#8217;.date(&#8220;Ym&#8221;, mktime(0,0,0,$month-1,1,$year)).&#8217;&#8221;&gt;&amp;laquo; Previous Month&lt;/a&gt;&lt;/th&gt;<br />
&lt;th colspan=&#8221;3&#8243;&gt;&#8217;.date(&#8220;F, Y&#8221;, mktime(0,0,0,$month,1,$year)).&#8217;&lt;/th&gt;<br />
&lt;th colspan=&#8221;2&#8243;&gt;&lt;a href=&#8221;?ym=&#8217;.date(&#8220;Ym&#8221;, mktime(0,0,0,$month+1,1,$year)).&#8217;&#8221;&gt;Next Month &amp;raquo;&lt;/a&gt;&lt;/th&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;th&gt;Sunday&lt;/th&gt;<br />
&lt;th&gt;Monday&lt;/th&gt;<br />
&lt;th&gt;Tuesday&lt;/th&gt;<br />
&lt;th&gt;Wednesday&lt;/th&gt;<br />
&lt;th&gt;Thursday&lt;/th&gt;<br />
&lt;th&gt;Friday&lt;/th&gt;<br />
&lt;th&gt;Saturday&lt;/th&gt;<br />
&lt;/tr&gt;&#8217;;<br />
// PHP code for calendar ends</p>
<p>?&gt;</p>
<p>&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;<br />
&lt;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221;&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=iso-8859-1&#8243; /&gt;<br />
&lt;title&gt;A Calendar Built in PHP&lt;/title&gt;</p>
<p>&lt;style type=&#8221;text/css&#8221;&gt;</p>
<p>#calendar tbody tr{ height:100px; }<br />
#calendar td{ width:100px; }<br />
#calendar th{background-color:#CCCC99;}<br />
.day{ background-color:#CCFFCC; }<br />
.holiday{ background-color:#FFCC66; }</p>
<p>&lt;/style&gt;</p>
<p>&lt;/head&gt;</p>
<p>&lt;body&gt;</p>
<p>&lt;h2&gt;A Calendar Built in PHP&lt;/h2&gt;</p>
<p>&lt;!&#8211; Table to display calendar &#8211;&gt;<br />
&lt;table id=&#8221;calendar&#8221; width=&#8221;710&#8243; border=&#8221;1&#8243; cellspacing=&#8221;0&#8243; cellpadding=&#8221;5&#8243;&gt;<br />
&lt;thead&gt;<br />
&lt;?php echo $calendar_head; ?&gt;<br />
&lt;/thead&gt;<br />
&lt;tbody&gt;<br />
&lt;?php echo $calendar_body; ?&gt;<br />
&lt;/tbody&gt;<br />
&lt;/table&gt;<br />
&lt;!&#8211; Table to display calendar &#8211;&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>The code is pretty easy to understand and you can figure out where to put your code to display your required info in the calendar. I used very basic CSS in this which you can style it as you wish.  Integrate it according to your requirements. Hope it would help you guys. Your feedback and suggestions are always welcomed.</p>
]]></content:encoded>
			<wfw:commentRss>http://rohitsengar.cueblocks.net/build-calendar-with-php/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Image Puzzle Using jQuery</title>
		<link>http://rohitsengar.cueblocks.net/image-puzzle-jquery/</link>
		<comments>http://rohitsengar.cueblocks.net/image-puzzle-jquery/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 06:04:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Freebies]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[backgound]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Drag]]></category>
		<category><![CDATA[Drop]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[jQuery UI]]></category>
		<category><![CDATA[Puzzle]]></category>
		<category><![CDATA[Sort]]></category>
		<category><![CDATA[Sortable]]></category>

		<guid isPermaLink="false">http://rohitsengar.cueblocks.net/?p=158</guid>
		<description><![CDATA[SOLVE THE PUZZLE We all had played image puzzle at some point in our life. The game in which we have to arrange various shuffled pieces of a picture in an order. The inspiration to build this game using jQuery, came into my mind when I was surfing the jQuery UI examples. In those examples [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Frohitsengar.cueblocks.net%2Fimage-puzzle-jquery%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Frohitsengar.cueblocks.net%2Fimage-puzzle-jquery%2F&amp;source=rohitsengar&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<blockquote><p style="text-align: center;"><a title="Click to open puzzle" href="http://rohitsengar.cueblocks.net/puzzle/" target="_blank">SOLVE THE PUZZLE</a></p>
</blockquote>
<p>We all had played image puzzle at some point in our life. The game in which we have to arrange various shuffled pieces of a picture in an order. The inspiration to build this game using jQuery, came into my mind when I was surfing the jQuery UI examples. In those examples there was a example of jQuery UI sortable() function, which can sort li elements in a grid. The same functionality is needed for the game, where user can sort it using drag and drop in order to arrange the pieces. And here is the result:</p>
<p><iframe src="http://rohitsengar.cueblocks.net/puzzle/frame.html" height="400" width="590" frameborder="0" style="border:1px solid #ababab;"></iframe></p>
<p>For building this game I used jQuery, ui.core.js, ui.sortable.js files. When user clicks on the &lt;ul&gt; (the container which have image as background), the &lt;ul&gt; is >filled with 9 &lt;li&gt; elements with 100px height &amp; width. Each &lt;li&gt; have same background image as of &lt;ul&gt;, but with different background-positions. Also the moves and time counter are incremented accordingly. After each drag and drop the order of &lt;li&gt; is checked. If order matches, then success message is displayed. The main functionality used here is the jQuery UI sortable() function.</p>
<p><a href="http://rohitsengar.cueblocks.net/puzzle/">You can try out the puzzle in new window</a>. Things are not hard as they look. We can create amazing things using already built functions/plugins/code of jQuery. Please share if you have developed something interesting or have some great ideas. Solve the puzzle in your free time&#8230; Have fun!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://rohitsengar.cueblocks.net/image-puzzle-jquery/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>A Fancy Image Gallery using jQuery</title>
		<link>http://rohitsengar.cueblocks.net/image-gallery-using-jquery/</link>
		<comments>http://rohitsengar.cueblocks.net/image-gallery-using-jquery/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 12:46:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Freebies]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Cool]]></category>
		<category><![CDATA[easing]]></category>
		<category><![CDATA[Effects]]></category>
		<category><![CDATA[Fancy]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Gallery]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[jQuery UI]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Unique]]></category>

		<guid isPermaLink="false">http://rohitsengar.cueblocks.net/?p=133</guid>
		<description><![CDATA[CLICK HERE TO CHECK IT OUT !!! Last week I thought of making a image gallery using jQuery (again not to mention I am one of jQuery&#8217;s fan). There were already so many nice image gallerias available online. People have almost used all the jQuery effects to create different gallerias. So, I was searching to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Frohitsengar.cueblocks.net%2Fimage-gallery-using-jquery%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Frohitsengar.cueblocks.net%2Fimage-gallery-using-jquery%2F&amp;source=rohitsengar&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<blockquote>
<p style="text-align: center;"><a title="Click to see the image gallary" href="http://rohitsengar.cueblocks.net/image-gallery/" target="_blank">CLICK HERE TO CHECK IT OUT !!!</a></p>
</blockquote>
<p>Last week I thought of making a image gallery using jQuery (again not to mention I am one of jQuery&#8217;s fan). There were already so many nice image gallerias available online. People have almost used all the jQuery effects to create different gallerias. So, I was searching to create something unique as its no fun to create what is already made.</p>
<div class="wp-caption aligncenter" style="width: 578px"><a href="http://rohitsengar.cueblocks.net/image-gallery/" target="_blank"><img title="Click to see Image Gallery" src="http://rohitsengar.cueblocks.net/image-gallery/Image-Gallery.png" alt="Image Gallery" width="568" height="365" /></a><p class="wp-caption-text">ScreenShot of Image Gallery</p></div>
<p>&nbsp;</p>
<p>Recently while browsering Cue Blocks Website (<a href="http://www.cueblocks.com/peopleatcb.php">http://www.cueblocks.com/</a>), I came across office gallery made in Flash which caught my eye. As it was built in Flash, the image were tilted at random angles, the images spreads on load, you can drag them anywhere inside gallery area and you can preview image by double clicking on it. Never seen such type of gallery built through jQuery. I imagined all these features can be implemented by jQuery (except for tilted images, for which there were no plugins available).</p>
<p>I found many of these effects can be implemented through jQuery UI or plugins. I built the logic in jQuery to spread the images randomly over gallery area. Used jQuery UI drag.js to make image thumbnail draggable. Easing plugin to give cool effects while spreading and showing preview. Then I thought of adding some auto animation in spreading images after some fixed interval of time. For which I used timer.js (jQuery plugin).</p>
<p>Result of all above is this <a title="Image Gallery" href="http://rohitsengar.cueblocks.net/image-gallery/" target="_blank">image gallery</a>. I am posting this on my blog so that you all can provide me your feedback and suggestions on it. I am planning to build a jQuery plugin for this, so all your ideas will be very helpful to me and hence welcomed.</p>
<p>Also, write to me if you want this gallery on your site.</p>
]]></content:encoded>
			<wfw:commentRss>http://rohitsengar.cueblocks.net/image-gallery-using-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tutorial to build a simple Content Slider using jQuery</title>
		<link>http://rohitsengar.cueblocks.net/tutorial-to-build-content-slider/</link>
		<comments>http://rohitsengar.cueblocks.net/tutorial-to-build-content-slider/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 10:38:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Content Slider]]></category>
		<category><![CDATA[simple]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://rohitsengar.cueblocks.net/?p=110</guid>
		<description><![CDATA[Content Slider is very popular now-a-days and used in various websites. You may choose from a wide range of jQuery plugins available online, or you can write it on your own. Yes it’s not a rocket science to create the content slider. This simple tutorial will guide you to build your own content slider, with [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Frohitsengar.cueblocks.net%2Ftutorial-to-build-content-slider%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Frohitsengar.cueblocks.net%2Ftutorial-to-build-content-slider%2F&amp;source=rohitsengar&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --></p>
<p style="margin-bottom: 0cm;">Content Slider is very popular now-a-days and used in various websites. You may choose from a wide range of jQuery plugins available online, or you can write it on your own. Yes it’s not a rocket science to create the content slider. This simple tutorial will guide you to build your own content slider, with simple Javascript code and animate() function provided in jQuery. This tutorial is divided into 4 parts – the html code, the style code, the jQuery code and additional functions.</p>
<p style="margin-bottom: 0cm;">&nbsp;</p>
<p style="margin-bottom: 0cm;"><a title="Content Slider Demo" href="http://rohitsengar.cueblocks.net/content-slider-tutorial/index.html" target="_blank">View Demo (online)</a> | <a title="Download Source Code" href="http://rohitsengar.cueblocks.net/content-slider-tutorial/download.php?f=content-slider.zip" target="_blank">Download Source Code (Zip)</a></p>
<p>&nbsp;</p>
<p style="margin-bottom: 0cm;"><span style="font-size: small;"><span style="text-decoration: underline;"><strong>The HTML Code</strong></span></span></p>
<p style="margin-bottom: 0cm;">Copy and paste the following code inside body code. The code has a div with id &#8220;content&#8221; which contains a list. In these li elements you can have any other content or images, which you want to show. The code also includes two buttons Previous and Next. We will bind functions to these buttons to slide the next or previous content with their onclick event. Instead of these buttons you can use any other element like anchor tag (place and style them as you wish), and add those functions on its onclick event. You can Copy Paste the code below inside &lt;body&gt; tag.</p>
<p style="margin-bottom: 0cm;"><code>&lt;div id="content"&gt;<br />
&lt;ul&gt;<br />
&lt;li&gt;Content for 1st li element.&lt;/li&gt;<br />
&lt;li&gt;Content for 2nd li element.&lt;/li&gt;<br />
&lt;li&gt;Content for 3rd li element.&lt;/li&gt;<br />
&lt;li&gt;Content for 4th li element.&lt;/li&gt;<br />
&lt;li&gt;Content for 5th li element.&lt;/li&gt;<br />
&lt;li&gt;Content for 6th li element.&lt;/li&gt;<br />
&lt;li&gt;Content for 7th li element.&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;/div&gt;<br />
&lt;button&gt;Previous&lt;/button&gt;<br />
&lt;button&gt;Next&lt;/button&gt;</code><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --></p>
<p>Now your page will look somewhat like <a title="html code" href="http://rohitsengar.cueblocks.net/content-slider-tutorial/html-code.html" target="_blank">html-code.html</a></p>
<p><span style="font-size: small;"><span style="text-decoration: underline;"><strong>The Style Code</strong></span></span></p>
<p>The diagram below explains the basic logic of content slider.</p>
<p>﻿</p>
<div class="wp-caption aligncenter" style="width: 570px"><img title="Layout of Content Slider" src="http://rohitsengar.cueblocks.net/content-slider-tutorial/Diagram.jpg" alt="Content Slider" width="560" height="180" /><p class="wp-caption-text">Layout of Content Slider</p></div>
<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } -->The div will remain fixed and the ul will be moved left or right in the background. The movement will be such that a li element will always shows up in the div. For implementing it we need to follow the styling below.</p>
<ol>
<li>The div will be of fixed width and 	height. The overflow property of the div should be set to hidden, so 	other li elements are not visible.</li>
<li>The ul should have position 	property relative and padding as 0px. It will help us in controlling 	its movement inside the div. The width of the ul should be 	multiplication of number of li elements and width of the div (3500px 	in our case).</li>
<li>The height and width of the div 	should be same as that of the div. The list-style and float 	properties should be set as none and left respectively.</li>
</ol>
<p>Therefore our style code will look like following. Copy Paste it into your page&#8217;s &lt;head&gt; section.</p>
<p><code>&lt;style type="text/css"&gt;<br />
#content { border: 1px solid blue; height: 300px; width: 500px; overflow: hidden; }<br />
#content ul { position: relative; width: 3500px; padding: 0px; }<br />
#content ul li { height: 300px; width: 500px; list-style: none;  float: left; }<br />
&lt;/style&gt;</code><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --></p>
<p>After putting the code run the html on browser. You page will look like <a title="Style Code" href="http://rohitsengar.cueblocks.net/content-slider-tutorial/style-code.html" target="_blank">style-code.html</a>. The first li element will be visible in the &#8220;content&#8221; div.</p>
<p><span style="font-size: small;"><span style="text-decoration: underline;"><strong>The jQuery Code</strong></span></span></p>
<p>First include the jQuery library in the page.</p>
<p><code>&lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt;</code><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --></p>
<p>Now we create functions inside the script tags. First let’s create the function to slide the content to show next li element in div. For that we need to move ul element in left. You need to keep following points in mind,</p>
<ol>
<li>Move ul to left using jQuery 	animate function. Initially the ul element left position is at 0px 	inside the div. Therefore we have to increment the left position of 	ul in negative.</li>
<li>The movement should be such that 	the next li element completely fits into the “content” div. So, 	we will add -500px (width of the div) to the left position.</li>
<li>When the last li element is 	reached, the function will do nothing. So, we need to check every 	time the function is called if the last element is reached or not. 	For that we need to see if the current position of the ul is greater 	than negative of the multiplication of width of div (500px) and one 	less in number of li element (which comes out to be -3000px in our 	case). If current position of ul is greater than -3000px then we can 	slide to next element. If current position of ul is equals to 	-3000px, its means the last li is visible in the div.</li>
</ol>
<p>Below is the function to slide to next li, copy paste it into &lt;head&gt; section</p>
<p><code>&lt;script type="text/javascript"&gt;<br />
function slideNext(){<br />
if(parseInt($("#content ul").css("left")) &gt; -3000)<br />
{<br />
$("#content ul").animate({<br />
left: parseInt($("#content ul").css("left"))-500+"px"<br />
},1000);<br />
}<br />
}<br />
&lt;/script&gt;</code><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --></p>
<p>For sliding to the previous li, the function needs to do following things,</p>
<ol>
<li>Move ul to right using jQuery 	animate function. We have to increment the left position of ul.</li>
<li>The movement should be such that 	the previous li element completely fits into the &#8220;content&#8221; div. 	So, we will add 500px (width of the div) to the left position of ul.</li>
<li>We need to check every time the 	function is called if the current li visible is first or not. For 	that we need to see if the current position of the ul is less than 	position of first li element i.e. 0px.</li>
</ol>
<p>Below is the function slide to previous li, which needs to be added inside the script tag along with the above slidePrev() function.</p>
<p><code>function slideNext(){<br />
if(parseInt($("#content ul").css("left")) &lt; 0)<br />
{<br />
$("#content ul").animate({<br />
left: parseInt($("#content ul").css("left"))+500+"px"<br />
},1000);<br />
}</code><br />
}<!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --></p>
<p>Now we just have to add these functions to the buttons onclick events as below,</p>
<p><code>&lt;button onclick="slidePrev();"&gt;Previous&lt;/button&gt;<br />
&lt;button onclick="slideNext();"&gt;Next&lt;/button&gt;</code><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --></p>
<p>Now your page will look like <a title="Jquery Code" href="http://rohitsengar.cueblocks.net/content-slider-tutorial/jquery-code.html" target="_blank">jquery-code.html</a>. That’s it, your content slider is ready. Now run the html page on browser and play with Next and Previous buttons. You can change the animation speed from 1000 to whatever you like to make the sliding slow or fast.</p>
<p><span style="font-size: small;"><span style="text-decoration: underline;"><strong>Additional Functions</strong></span></span></p>
<p>You can add more functions to your content slider, like slide to the first element or slide to last element or slide to any particular li element. Copy paste following functions  into &lt;script&gt; tags along with previous functions.<br />
<code><br />
function slideFirst(){<br />
$("#content ul").animate({ left: "0px" },1000);<br />
}<br />
function slideLast(){<br />
$("#content ul").animate({ left: "-3000px" },1000);<br />
}<br />
function slideTo(x){<br />
$("#content ul").animate({<br />
left: "-"+(500*x)+"px" // 500 is the width of the div<br />
},1000);<br />
}</code><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --></p>
<p>Create buttons/anchor tags for these functions and add these functions to their onclick events. The final page will look somewhat like <a title="Additional Code" href="http://rohitsengar.cueblocks.net/content-slider-tutorial/additional-code.html" target="_blank">additional-code.html</a>.</p>
<p>You can also use jQuery easing plugin and apply different easing effects on jQuery animate function. This will add great attraction to your content slider.</p>
<p>I tried to make this tutorial as simple as possible. If you have any difficulty or confusion at any step, feel free to post your queries. Also let me know if you need tutorial on any other topic or plug-in. Now create your own content sliders and have fun!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://rohitsengar.cueblocks.net/tutorial-to-build-content-slider/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>JQuery Pagination Plugin</title>
		<link>http://rohitsengar.cueblocks.net/jquery-pagination-plugin/</link>
		<comments>http://rohitsengar.cueblocks.net/jquery-pagination-plugin/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 06:57:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Freebies]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[customize]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[Pagination]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[simple]]></category>

		<guid isPermaLink="false">http://rohitsengar.cueblocks.net/?p=69</guid>
		<description><![CDATA[Downloaded more than 2000 times. After using various jQuery plugins for pagination, I decided to write my own jQuery paginator plugin. While creating this plugin, I tried to overcome other plugin’s limitations and make it easy &#38; highly customizable to meet demands of most of developers. Here are few features of this plugin, 1)      Very [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Frohitsengar.cueblocks.net%2Fjquery-pagination-plugin%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Frohitsengar.cueblocks.net%2Fjquery-pagination-plugin%2F&amp;source=rohitsengar&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<blockquote>
<p style="text-align: center;"><strong>Downloaded more than 2000 times.<br />
</strong></p>
</blockquote>
<p style="text-align: left;">After using various jQuery plugins for pagination, I decided to write my own jQuery paginator plugin. While creating this plugin, I tried to overcome other plugin’s limitations and make it easy &amp; highly customizable to meet demands of most of developers. Here are few features of this plugin,</p>
<p>1)      Very simple. Just 1 line of code to apply pagination on any div/container.</p>
<p>2)      No need for creating extra divs for pagination.</p>
<p>3)      4 styles of pagination.</p>
<p>4)      Various other options like jump to page, page info and change items per page on fly.</p>
<p>5)      Easy customization and styling.</p>
<p>6)      Nice fading effect during changing of page.</p>
<p><strong><span style="text-decoration: underline;">Why use it?</span></strong> Often you have large number of items/data in a div, which not only breaks your design but also looks ugly and lengthy. Apply this plugin on that div and you will get a nice seamless pagination on that div, which don’t break your design and visitors can easily navigate to all the items. You can style or it customize according to your requirements.   <a title="pagination demo" href="http://rohitsengar.cueblocks.net/paginator/example2.html" target="_blank">See Demo.</a></p>
<p><strong><span style="text-decoration: underline;">Implementation</span></strong>:</p>
<p>1)      Download latest <a title="download jquery script" href="http://jquery.com/" target="_blank"><span style="text-decoration: underline;">jquery script</span></a> and <a title="download pagination script" href="http://rohitsengar.cueblocks.net/paginator/download.php?f=paginator.js" target="_blank"><span style="text-decoration: underline;">paginator.js</span></a></p>
<p>2)      Include both scripts in html document in head section.</p>
<p><code>&lt;script src="js/jquery.js"&gt;&lt;/script&gt;<br />
&lt;script src="js/paginator.js"&gt;&lt;/script&gt;</code></p>
<p>3)      Initiate pagination by  writing following code in head section inside &lt;script&gt; tags,</p>
<p><code>&lt;script&gt;<br />
$(function(){ $("#<em>&lt;id_of_div&gt;</em>").pagination(); });<br />
&lt;/script&gt;</code></p>
<p>// instead of <em>&lt;id_of_div&gt;</em>, type in id of the div on which you want to create pagination.</p>
<p>Its all you need to do. Load the page on browser and now you can see a simple, basic pagination on the page. <a title="simple pagination demo" href="http://rohitsengar.cueblocks.net/paginator/example1.html" target="_blank">See Demo</a>.</p>
<p><strong><span style="text-decoration: underline;">Customization</span></strong>:</p>
<p>1)      <strong>Style Paginator</strong>: There are 3 classes – paginator (container for paginator), active (class for active pages) and inactive (class for current page). We can apply little css on these classes to make paginator looks pretty, either in document itself or in stylesheet. <a title="pagination demo with some style" href="http://rohitsengar.cueblocks.net/paginator/example2.html" target="_blank">See demo</a></p>
<p><code>&lt;style type="text/css"&gt;<br />
.active<br />
{<br />
color:#0033CC;<br />
border: solid 1px #0000FF;<br />
padding:3px 5px;<br />
margin:5px;<br />
text-decoration:none;<br />
}<br />
.inactive<br />
{<br />
color:#000000;<br />
cursor:default;<br />
text-decoration:none;<br />
border: solid 1px #0000FF;<br />
background-color:#0099FF;<br />
padding:3px 5px;<br />
margin:5px;<br />
}<br />
&lt;/style&gt;</code></p>
<p>2)      <strong>Paginator Style</strong>: Open <em>paginator.js</em>, there is a variable called <code>paginatorStyle</code>. This variable accepts values from 1 to 4, for displaying different styles of paginator.  More info is given in comments below that.</p>
<p>3)      <strong>Pagination Position</strong>: By default the position of paginator is below the div where pagination is applied. In <em>paginator.js</em> you can change <code>paginatorPosition</code> to ‘top’ if you want paginator to be on the top instead of bottom, or ‘both’ if you want it to be on both (top and bottom).</p>
<p>4)      <strong>Changing Symbols</strong>: Open <em>paginator.js</em>, there are variables like <code>firstPageSymbol, previousPageSymbol, nextPageSymbol, lastPageSymbol</code>. You can change these symbols, so instead of &lt;&lt; as symbol for first page, you can write FIRST PAGE, or give img tag if you want fancy image for first page. Also, there is a variable called separator, which will appear in-between page options. Make it blank if you don’t want it.</p>
<p>5)      <strong>Changing Items per page and Start Page</strong>: By default there are 5 items per page and start page for pagination is first page. You can change them in <em>paginator.js</em>, the variables are named <code>itemsPerPage</code> and <code>startPage</code>.</p>
<p>6)      <strong>Enabling other options</strong>: There are 3 options available, like goto to page, change items per page, display page info. By default these are disabled, you can enable them according to your needs. You can enable them by replacing false with true as variables value, in <em>paginator.js</em>. More info is given in comments besides each option.</p>
<p>7)      <strong>Calling pagination again after changing content</strong>: If you change content, upon which pagination is applied in-between, just call <code>initPaginator();</code> after changing content. It will apply pagination again on the new content with same previous settings.</p>
<p>8)      <strong>De-paginating Content </strong>: At any time, if you want to remove pagination from the content, just call <code>$("#&lt;id_of_div&gt;").depagination(); </code>You can call <code>$("#</code><code>&lt;id_of_div&gt;</code><code>").pagination(); </code> to apply pagination again on same or any other content. Kindly remember, at one time you can apply pagination on only one div or content. If you want to apply pagination on other div during program, first call depagination function on previous div and then pagination function on new div.</p>
<p>9)      <strong>Don’t want to open paginator.js</strong>: No worries, if you don’t want to change these variables in <em>paginator.js</em>, you can still change these variables in html documents just before calling the pagination function. Like <a title="pagination demo with some customization" href="http://rohitsengar.cueblocks.net/paginator/example3.html" target="_blank">See Demo</a>.</p>
<p><code>$(function(){<br />
itemsPerPage = 3;<br />
paginatorStyle = 2;<br />
paginatorPosition = 'both';<br />
enableGoToPage = true;<br />
$("#result").pagination();<br />
});</code></p>
<p>That’s it. Apply it wherever you want. Play around it with, try different styles and options. <a title="Email" href="mailto:rohitsinghsengar@gmail.com">Email me</a> in case of any bug, error, confusion or you need any further assistance/customization. All kinds of feedbacks are appreciated and welcomed.</p>
<p>I also recently uploaded uncompressed version of the plugin for development purposes, <a title="download pagination script for development purposes" href="http://rohitsengar.cueblocks.net/paginator/download.php?f=paginator_dev.js" target="_blank">download it</a>. feel free to download and extend it. Also, I have uploaded this plugin on jquery plugin directory. Here is the link &#8211; <a title="Pagination Plugin in Jquery Plugin directory" href="http://plugins.jquery.com/project/jquery-pagination" target="_blank">http://plugins.jquery.com/project/jquery-pagination</a></p>
<div class="wp-caption aligncenter" style="width: 504px"><img title="Tested in all major Browsers" src="http://www.zee.com.br/files/bw/all_browsers.jpg" alt="Tested in all major Browsers" width="494" height="200" /><p class="wp-caption-text">Tested in all major Browsers</p></div>
]]></content:encoded>
			<wfw:commentRss>http://rohitsengar.cueblocks.net/jquery-pagination-plugin/feed/</wfw:commentRss>
		<slash:comments>93</slash:comments>
		</item>
		<item>
		<title>Why Facebook is following Twitter?</title>
		<link>http://rohitsengar.cueblocks.net/facebook-following-twitter/</link>
		<comments>http://rohitsengar.cueblocks.net/facebook-following-twitter/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 12:21:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://rohitsengar.cueblocks.net/?p=58</guid>
		<description><![CDATA[Twitter caught the eyes of people with its unique idea of micro blogging. Twitter provided the stage and the way to say what you feel like, to whole world with 140 characters. Growing number of twitter users proved that the world is accepting and going with twitter. The Facebook (referred as fb in this article) [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Frohitsengar.cueblocks.net%2Ffacebook-following-twitter%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Frohitsengar.cueblocks.net%2Ffacebook-following-twitter%2F&amp;source=rohitsengar&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img class="alignleft size-full wp-image-63" title="facebook-twitter_logo" src="http://rohitsengar.cueblocks.net/wp-content/uploads/2009/09/facebook-twitter_logo.jpg" alt="facebook-twitter_logo" width="245" height="166" />Twitter caught the eyes of people with its unique idea of micro blogging. Twitter provided the stage and the way to say what you feel like, to whole world with 140 characters. Growing number of twitter users proved that the world is accepting and going with twitter. The Facebook (referred as fb in this article) on the other hand is the biggest medium to be social on internet. Fb has largest user base in social networking. Idea of fb is completely different and deals with sharing your personal life with your friends and staying updated on what happening in your friend circle.</p>
<p>However, It became quite obvious after fb brought Friend feed, that it will go twitter’s way. Fb started status message. Recently gave option to open your status message to world and allowed third party applications to access its API. Just few days back it introduced the mention feature with @, same as twitter. Clearly, fb trying to adopt the twitter idea to reach maximum people and retains its own users from going to twitter.</p>
<p><img class="aligncenter size-full wp-image-62" title="Facebook peope &amp; twitter" src="http://rohitsengar.cueblocks.net/wp-content/uploads/2009/09/final.jpg" alt="Facebook peope &amp; twitter" width="600" height="200" /></p>
<p>So, what makes the Fb to follow twitter? Here are some of main reasons,</p>
<p>1.	Growing popularity of twitter: Even fb is the big boss in online social networking, it certainly sense the growing number of people using twitter. It was apparent that fb users are turning to twitter for its ability to reach out to maximum people than fb. Fb certainly doesn’t want its users to go for some other service and as result fb decided to implement same functionality within its own app.</p>
<p>2.	Real time searches: This is muscular feature twitter came up with. After Google taken over the searching on internet, this unique feature proved very crucial for twitter in setting its position on internet. With Real time searches twitter soon became the apple of everyone’s eye. It was very easy for twitter as people are tweeting like hell every second and from every part of world. Moreover twitter already has efficient and reliable search algorithm, structure and server power to back this feature. Along with that, twitter is coming with geo location for every tweet, adding new dimension to its search. Google and fb both are looking to grab on to this feature, because it is going to be very critical which of these three make most of it, because I think it is surely going to be next big thing on internet.</p>
<p>3.	Reach to maximum people: With fb you are linked to your friends and some known ones. Your reach is limited and bonded by fb privacy terms. You cannot state your viewpoint to whole world.  Twitter overcame this without much difficultly as its idea was clear to provide people a universal platform, to reach masses with your tweet. That’s the reason which attracted many celebrities and famous personalities to twitter.</p>
<p>4.	Twitter versatilities: People use fb to be in touch with friends. On the other side twitter can be used in various ways like conversation, spreading idea, links, giving opinion, stating one’s viewpoint or simply conveying world what you are doing. Well you can say fb allows photo and video sharing which is absent from twitter. But twitter showed maturity on this by providing third parties its API to create applications which fills its void of media sharing. Twitter apps grown hastily and used twitter’s 140 characters in so many different and creative ways, is just in sane.  These app ranges from business to entertainment to information to anything you can think of. I personally like twitter apps more than fb’s useless games, quizzes and questionnaires.</p>
<p>What-so-ever be the reason, the fact that fb going after twitter, makes a point very clear that twitter has lots of potential which can turn social networking in big way. Fb doesn’t want to lose his grip on social networking. Whichever way this struggle goes, the ultimate judge is audience. Personally I feel it is the idea or its excellent implementation which is going turn stone for these social networking giants on internet. Lastly, may the best application wins.</p>
]]></content:encoded>
			<wfw:commentRss>http://rohitsengar.cueblocks.net/facebook-following-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stupid Mistakes I made</title>
		<link>http://rohitsengar.cueblocks.net/stupid-mistakes-i-made/</link>
		<comments>http://rohitsengar.cueblocks.net/stupid-mistakes-i-made/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 10:11:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[common]]></category>
		<category><![CDATA[mistakes]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://rohitsengar.cueblocks.net/?p=50</guid>
		<description><![CDATA[Well this is about the unbelievable but honestly UN-intentional mistakes I made during programming. It might sound funny but true that we programmers (Intelligent techie geeks) often make some stupid and illogical mistakes. I beg to differ from those programmers who didn&#8217;t agree with this generalization. However, I often hear about similar silly mistakes been [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Frohitsengar.cueblocks.net%2Fstupid-mistakes-i-made%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Frohitsengar.cueblocks.net%2Fstupid-mistakes-i-made%2F&amp;source=rohitsengar&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Well this is about the unbelievable but honestly UN-intentional mistakes I made during programming. It might sound funny but true that we programmers (Intelligent techie geeks) often make some stupid and illogical mistakes. I beg to differ from those programmers who didn&#8217;t agree with this generalization. However, I often hear about similar silly mistakes been made by my fellow programmers and friends.</p>
<p>When program don&#8217;t run as I expected, I start debugging the program rigorously, looking at each line of code to find out what went wrong. Seldom, despite of my best efforts and hours of frustration, I cannot figure out the bug. After that I have to keep my programming self respect at bay and call upon my co-programmers to rescue me. Here comes the most embarrassing moment. The error has been found and it happens to be a missing &#8220;+&#8221; sign. It was in front of me<br />
and I had gone through many times, still cannot figure it out. I had experienced this situation many times during programming. Here are some of them,</p>
<p>After one year of programming in PHP, one of my friends asked me for help on some C++ program. I wrote the program and emailed him. Next day I get call from him, telling the program is giving lots of errors during compilation. I checked the program and soon I realized that I had mixed PHP in C++. I had declared variables as int $xyz = 0; which should be without dollar sign (int xyz=0;). When I told about this to my friend, he advised me not to do similar things in PHP.</p>
<p>Next one took almost 2 hours to figure out that it was just a spelling mistake. The PHP program I made generates results with link. Everything is fine in the page except for some links on left sidebar. Those are not appearing as link on browser besides having anchor tag. While other anchor tags were showing correctly as links on browser these are shown as simple text. I checked again and again just to find the code was correct in every way. I tested it on all<br />
browsers but result was same. Then my senior programmer pointed out a silly spelling mistake in my code. I had written &lt;a herf=&#8221;&#8230;</p>
<p>Recently, I was working a lot in JavaScript for one of my project. While programming backend for the project, I encountered a strange problem. I was returning some text from database through Ajax. On the browser it was showing a big zero instead of text. After all the regular debugging I have to call my colleague. He smiled when he looked at my code. Soon I know that it was one of those embarrassing moments. I had used plus(+) sign instead of dot(.) sign to concate the strings in PHP. Plus sign is used in JavaScript for string concatenation.</p>
<p>Obviously, these were not my best days and this post is its going to spoil my portfolio. Anyways, I surely will be updating this post till I become perfect in programming. Also I am expecting some contributions in this from honest programmers.</p>
]]></content:encoded>
			<wfw:commentRss>http://rohitsengar.cueblocks.net/stupid-mistakes-i-made/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Highlight Your Searches</title>
		<link>http://rohitsengar.cueblocks.net/highlight-your-searches/</link>
		<comments>http://rohitsengar.cueblocks.net/highlight-your-searches/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 09:32:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Highlight]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://rohitsengar.cueblocks.net/?p=10</guid>
		<description><![CDATA[Recently I was strucked with one BIG problem in programming my one of the application. How to highlight the search phases in the result through javascript? The problem was simple enough for any programmer and there are lots of srcipts available online. However, this problem is lot more complicated than it seems to be. The [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Frohitsengar.cueblocks.net%2Fhighlight-your-searches%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Frohitsengar.cueblocks.net%2Fhighlight-your-searches%2F&amp;source=rohitsengar&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Recently I was strucked with one BIG problem in programming my one of the application. How to highlight the search phases in the result through javascript? The problem was simple enough for any programmer and there are lots of srcipts available online.</p>
<p>However, this problem is lot more complicated than it seems to be. The searched result should be checked for any link, hashtag or at the rate symbol. If found the script needs to convert them into a specific link. That&#8217;s fine, I searched on google, found some script and implemented them without any much difficulty.</p>
<p>The real problem arises when after converting all links I need to highlight searched phase in result. The very initial reaction was to search for the phase and replace it with &lt;span class=&#8221;highlight&#8221;&gt;word&lt;/span&gt;. However, this script searches for the word even inside the anchor tag or any other tag &#8230; and boom everything is converted into link or some codeline.</p>
<p>Therefore, I needed some script which does not search for the word inside anchor or any tag. I know Regex is the solution but I am not so good at it. Even after lots of searching, I I just found related questions and solutions that never worked for me. The problem presist.</p>
<p>Yesterday, I encountered one of the articles on devthought.com by Guillermo Rauch. He has written code for highlighting searched word as extended function in jquery and mootool. As I was already using Jquery, I decided to give this code a try. I modified the code to fit into my application and it worked flawlessly.</p>
<p>The article can be reached <a title="Highlight scirpt" href="http://devthought.com/blog/client-side/2009/04/javascript-regexp-based-highlighting-function-for-mootools-and-jquery/" target="_blank">here</a>. It helped me a lot in highlighting the searches in result. It can be used anywhere with any script for highlighting anything. Its really amazing that how any small function can solve BIG problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://rohitsengar.cueblocks.net/highlight-your-searches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

