<?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>Bagesh Singh&#039;s Blog &#187; javascript</title>
	<atom:link href="http://www.bageshsingh.com/bagesh-blog/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bageshsingh.com/bagesh-blog</link>
	<description>Shortest Distance to  Web Solutions &#38; Software Solutions</description>
	<lastBuildDate>Wed, 22 Feb 2012 18:42:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Using Javascript to POST Data Between Pages</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/08/using-javascript-to-post-data-between-pages/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/08/using-javascript-to-post-data-between-pages/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 18:27:32 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Javascript Interview Questions]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1551</guid>
		<description><![CDATA[The following is a simple example of how to submit data from one HTML page to another using the POST method from Javascript. Normally, if data needs to be sent from one HTML page to another, it is done by appending the information to the query parameter of the the URL in the familiar â€œname=valueâ€ [...]]]></description>
			<content:encoded><![CDATA[<p>The following is a simple example of how to submit data from one HTML page to another using the POST method from Javascript. Normally, if data needs to be sent from one HTML page to another, it is done by appending the information to the query parameter of the the URL in the familiar â€œname=valueâ€ format. e.g.</p>
<div>
<div id="highlighter_831382">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
</td>
<td>
<div>
<div><code>&lt;a href=</code><code>"post.aspx?user=peter&amp;cc=aus"</code><code>&gt;Click&lt;/a&gt;</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Although this works fine, in most cases, problems occur when there is a lot of data to send and the URL exceeds about 2000 characters. The other disadvantage is that the URL looks ugly. The traditional method to get around this is to POST the data using a form. e.g.</p>
<div>
<div id="highlighter_372143">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</td>
<td>
<div>
<div><code>&lt;form name=</code><code>"myform"</code> <code>method=</code><code>"post"</code> <code>action=</code><code>"post.aspx"</code><code>&gt;</code></div>
<div><code>&lt;input name=</code><code>"user"</code> <code>value=</code><code>"peter"</code><code>/&gt;</code></div>
<div><code>&lt;input value=</code><code>"cc"</code> <code>value=</code><code>"aus"</code><code>/&gt;</code></div>
<div><code>&lt;a href=</code><code>"javascript:myform.submit()"</code><code>&gt;Click&lt;/a&gt;</code></div>
<div><code>&lt;form&gt;</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>This works fine, however, it tends to make the formatting of the resulting HTML difficult and increases the size of the final HTML page significantly if there are lots of links on it.</p>
<p>The following javascript function takes the URL of the target page and an associative array of name/values paires and POSTs the data to the supplied URL by dynamically creating a form and then submitting it.</p>
<div>
<div id="highlighter_101606">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
<div>13</div>
<div>14</div>
</td>
<td>
<div>
<div><code>function</code> <code>postwith (to,p) {</code></div>
<div><code>  </code><code>var</code> <code>myForm = document.createElement(</code><code>"form"</code><code>);</code></div>
<div><code>  </code><code>myForm.method=</code><code>"post"</code> <code>;</code></div>
<div><code>  </code><code>myForm.action = to ;</code></div>
<div><code>  </code><code>for</code> <code>(</code><code>var</code> <code>k in p) {</code></div>
<div><code>    </code><code>var</code> <code>myInput = document.createElement(</code><code>"input"</code><code>) ;</code></div>
<div><code>    </code><code>myInput.setAttribute(</code><code>"name"</code><code>, k) ;</code></div>
<div><code>    </code><code>myInput.setAttribute(</code><code>"value"</code><code>, p[k]);</code></div>
<div><code>    </code><code>myForm.appendChild(myInput) ;</code></div>
<div><code>  </code><code>}</code></div>
<div><code>  </code><code>document.body.appendChild(myForm) ;</code></div>
<div><code>  </code><code>myForm.submit() ;</code></div>
<div><code>  </code><code>document.body.removeChild(myForm) ;</code></div>
<div><code>}</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>To insert a link into a page just use a normal anchor tag in the HTML and call the function.</p>
<div>
<div id="highlighter_670493">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
</td>
<td>
<div>
<div><code>&lt;a href=</code><code>"javascript:postwith('post.aspx',{user:'peter',cc:'aus'})"</code><code>&gt;click&lt;/a&gt;</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>This works on Microsoft IE, Mozilla Firefox and OS X Safari.</p>
<div id="seo_alrp_related"><h2>Posts Related to Using Javascript to POST Data Between Pages </h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/03/how-to-pass-javascript-variable-to-php/" rel="bookmark">how to Pass javascript variable to PHP</a></h3><p>There is lots of way to pass the php script data in javascript like simply echoing php varible in PHP. Yes you can simply echo ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/03/javascript-interview-questions-%e2%80%93-fifth-part-of-jquery-interview-question/" rel="bookmark">Javascript Interview Questions – Fifth Part of Jquery Interview question</a></h3><p>What is the difference between the three following scenarios:   var myFunction = function() { var person; person; window.person; } The first is local variable, ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/06/how-cross-site-scripting-xss-browser-attacks/" rel="bookmark">How Cross Site Scripting XSS browser attacks</a></h3><p>Now a days Web applications are becoming more and more dynamic. Dynamic websites means contents shown on web page are pulled dynamically depending on some ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/03/javascript-interview-questions-%e2%80%93-second-part-of-jquery-interview-question/" rel="bookmark">Javascript Interview Questions – Second Part of Jquery Interview question</a></h3><p>What is JavaScript? JavaScript is a general-purpose programming language designed to let programmers of all skill levels control the behavior of software objects. The language ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/7-useful-functions-to-tighten-the-security-in-php/" rel="bookmark">7 Useful functions to tighten the security in PHP</a></h3><p>Security is a very important aspect of programming. In PHP, there are few useful functions which is very handy for preventing your website from various ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/08/using-javascript-to-post-data-between-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check or Uncheck All in a Group of Checkbox in JavaScript</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/08/check-or-uncheck-all-in-a-group-of-checkbox-in-javascript/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/08/check-or-uncheck-all-in-a-group-of-checkbox-in-javascript/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 18:25:27 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Javascript Interview Questions]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1543</guid>
		<description><![CDATA[JavaScript code to be kept before head tag. 1 2 3 4 5 6 7 8 9 10 11 12 13 &#60;SCRIPT LANGUAGE="JavaScript"&#62; function CheckAll(chk) { for (i = 0; i &#60; chk.length; i++) chk[i].checked = true ; } function UnCheckAll(chk) { for (i = 0; i &#60; chk.length; i++) chk[i].checked = false ; } [...]]]></description>
			<content:encoded><![CDATA[<p>JavaScript code to be kept before head tag.</p>
<div>
<div id="highlighter_636434">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
<div>13</div>
</td>
<td>
<div>
<div><code>&lt;SCRIPT LANGUAGE=</code><code>"JavaScript"</code><code>&gt;</code></div>
<div><code>function</code> <code>CheckAll(chk)</code></div>
<div><code>{</code></div>
<div><code>for</code> <code>(i = 0; i &lt; chk.length; i++)</code></div>
<div><code>chk[i].checked = true ;</code></div>
<div><code>}</code></div>
<div></div>
<div><code>function</code> <code>UnCheckAll(chk)</code></div>
<div><code>{</code></div>
<div><code>for</code> <code>(i = 0; i &lt; chk.length; i++)</code></div>
<div><code>chk[i].checked = false ;</code></div>
<div><code>}</code></div>
<div><code>&lt;/script&gt;</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>HTML Code:</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
</td>
<td>
<div>
<div><code>&lt;form name=</code><code>"myform"</code> <code>action=</code><code>"checkboxes.asp"</code> <code>method=</code><code>"post"</code><code>&gt;</code></div>
<div><code>&lt;b&gt;Scripts </code><code>for</code> <code>Web design </code><code>and</code> <code>programming&lt;/b&gt;&lt;br&gt;</code></div>
<div><code>&lt;input type=</code><code>"checkbox"</code> <code>name=</code><code>"check_list"</code> <code>value=</code><code>"1"</code><code>&gt;ASP&lt;br&gt;</code></div>
<div><code>&lt;input type=</code><code>"checkbox"</code> <code>name=</code><code>"check_list"</code> <code>value=</code><code>"2"</code><code>&gt;PHP&lt;br&gt;</code></div>
<div><code>&lt;input type=</code><code>"checkbox"</code> <code>name=</code><code>"check_list"</code> <code>value=</code><code>"3"</code><code>&gt;JavaScript&lt;br&gt;</code></div>
<div><code>&lt;input type=</code><code>"checkbox"</code> <code>name=</code><code>"check_list"</code> <code>value=</code><code>"4"</code><code>&gt;HTML&lt;br&gt;</code></div>
<div><code>&lt;input type=</code><code>"checkbox"</code> <code>name=</code><code>"check_list"</code> <code>value=</code><code>"5"</code><code>&gt;MySQL&lt;br&gt;</code></div>
<div></div>
<div><code>&lt;input type=</code><code>"button"</code> <code>name=</code><code>"Check_All"</code> <code>value=</code><code>"Check All"</code></div>
<div><code>onClick=</code><code>"CheckAll(document.myform.check_list)"</code><code>&gt;</code></div>
<div><code>&lt;input type=</code><code>"button"</code> <code>name=</code><code>"Un_CheckAll"</code> <code>value=</code><code>"Uncheck All"</code></div>
<div><code>onClick=</code><code>"UnCheckAll(document.myform.check_list)"</code><code>&gt;</code></div>
</div>
</td>
</tr>
</tbody>
</table>
<div id="seo_alrp_related"><h2>Posts Related to Check or Uncheck All in a Group of Checkbox in JavaScript </h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/html-dom-creating-checkbox-dynamically/" rel="bookmark">html dom creating checkbox dynamically</a></h3><p></p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/02/using-the-jquery-validation-plugin-to-choose-atleast-one-checkbox-before-submitting-the-form/" rel="bookmark">Using the jQuery Validation Plugin to choose atleast one CheckBox before submitting the Form</a></h3><p>Let us see how to use the jQuery Validation Plugin to choose atleast one checkbox before submitting the form &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt; &lt;head&gt; &lt;style ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/jquery-thumbnail-image-with-heading-and-caption/" rel="bookmark">Jquery Thumbnail Image with Heading and Caption</a></h3><p>Let's review a topic about how to create a Jquery Thumbnail Image with Heading and Caption. Have you ever seen Jquery Thumbnail Image with Heading ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/adding-custom-javascript-on-admin-form-in-magento-backend-2/" rel="bookmark">Adding Custom Javascript on Admin form in Magento (Backend)</a></h3><p>Sometimes in Magento, while creating a custom module we need to add our custom Javascript code in our Admin form. These Admin forms we create ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/10/adding-custom-javascript-on-admin-form-in-magento-backend/" rel="bookmark">Adding Custom Javascript on Admin form in Magento (Backend)</a></h3><p>Sometimes in Magento, while creating a custom module we need to add our custom Javascript code in our Admin form. These Admin forms we create ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/08/check-or-uncheck-all-in-a-group-of-checkbox-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to do Date format validation in PHP</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-do-date-format-validation-in-php/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-do-date-format-validation-in-php/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 17:43:58 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[how-to]]></category>
		<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Javascript Interview Questions]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Php interview question]]></category>
		<category><![CDATA[tips and technique]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1459</guid>
		<description><![CDATA[Today Sushil asked me how can we validate the date which is entered from textbox in “YYYY-MM-DD” format. Well, we can validate the format of the date using regular expression but how to validate weather that date is valid date or not, such as “2007-02-29″ is the correct format of the date but it’s not [...]]]></description>
			<content:encoded><![CDATA[<p>Today Sushil asked me how can we validate the date which is entered from textbox in “YYYY-MM-DD” format. Well, we can validate the format of the date using regular expression but how to validate weather that date is valid date or not, such as “2007-02-29″ is the correct format of the date but it’s not the valid date.</p>
<p>&nbsp;</p>
<p>To overcome that situation, I’ve used checkdate() function available in PHP for validation of date.</p>
<h4>Function to validate date format in PHP</h4>
<pre>function checkDateFormat($date)
{
  //match the format of the date
  if (preg_match ("/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/", $date, $parts))
  {
    //check weather the date is valid of not
        if(checkdate($parts[2],$parts[3],$parts[1]))
          return true;
        else
         return false;
  }
  else
    return false;
}</pre>
<p>In the above function, first of all format of date is validated using regular expression. As you can see the in the preg_match() function, there are three expression each separated by “-” and there can be only digits of length of 4,2 and 2 in these expressions. If the date format is incorrect then this function returns “false” value. And, if the supplied string contains the valid date format then the part matching each expression are stored in the “$parts” array. Such as, if we supply “2007-03-12″ then “2007″, “03″ and “12″ are stored in the “$parts” array. After that, checkdate() function of PHP is used check weather the supplied date is valid date or not.</p>
<h4>Example</h4>
<pre>echo checkDateFormat("2008-02-29"); //return true
echo checkDateFormat("2007-02-29"); //return false</pre>
<div id="seo_alrp_related"><h2>Posts Related to How to do Date format validation in PHP</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/05/php-date-functions-list/" rel="bookmark">PHP Date Functions List</a></h3><p>checkdate — Validate a gregorian date date — Format a local time/date getdate — Get date/time information gettimeofday — Get current time gmdate — Format ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/ip-address-validation-in-php-using-regular-expression/" rel="bookmark">Ip address validation in PHP using regular expression</a></h3><p>If you don’t know how to validate the IP address format in PHP, then you are in the right place.I’ll show you here how to ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/jquery-ui-datepicker-disable-specified-days/" rel="bookmark">jQuery UI DatePicker: Disable Specified Days</a></h3><p>One project I'm currently working on requires jQuery. The project also features a datepicker for requesting a visit to their location. jQuery UI's DatePicker plugin ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/usa%e2%80%99s-zip-code-validation-in-php/" rel="bookmark">USA’s Zip Code Validation in PHP</a></h3><p>My friend Sushil was trying to write the regular expression for validating the format of the zip code of USA. After spending few minutes, I ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/02/jquery-datepicker-%e2%80%93-select-a-date-programmatically/" rel="bookmark">jQuery DatePicker – Select a Date Programmatically</a></h3><p>I have seen users asking how to programmatically select a date using jQuery UI DatePicker control. The DatePicker beforeShowDay event is ideal for this type ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-do-date-format-validation-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blocking access to the login page after three unsuccessful login attempts</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/08/blocking-access-to-the-login-page-after-three-unsuccessful-login-attempts/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/08/blocking-access-to-the-login-page-after-three-unsuccessful-login-attempts/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 17:21:30 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Others]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Php interview question]]></category>
		<category><![CDATA[tips and technique]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[ATTEMPTS]]></category>
		<category><![CDATA[AUTHORIZATION DEMO]]></category>
		<category><![CDATA[BLOCKING]]></category>
		<category><![CDATA[LOGIN]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[RESTRICTION]]></category>
		<category><![CDATA[UNSUCCESSFUL]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1439</guid>
		<description><![CDATA[Sometimes you need to add an extra protection to password-protected website. This article explains how access to the login page can be restricted after three unsuccessful login attempts. This schema uses visitors IP address to store log attempts in the database and block access to login feature for 30 minutes after third unsuccessful attempt. There [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">Sometimes you need to add an extra protection to password-protected website. This article explains how access to the login page can be restricted after three unsuccessful login attempts. This schema uses visitors IP address to store log attempts in the database and block access to login feature for 30 minutes after third unsuccessful attempt.</p>
<p align="justify">There are a number of reasons to restrict access. One reason is security. Quite often users try to guess login and password combination to get unauthorized access to the system. Another reason is extra load on server.</p>
<p align="justify">So let&#8217;s start. At first you need to create a new table in your database to store information about login attempts from a certain computer. SQL script creating such table in MySQL Server will be the following. For other databases it will slightly differ.</p>
<table cellspacing="1">
<tbody>
<tr>
<td id="post-main-8648" valign="top" width="100%">
<div>
<div>CREATE TABLE `LoginAttempts`<br />
(<br />
`IP` VARCHAR( 20 ) NOT NULL ,<br />
`Attempts` INT NOT NULL ,<br />
`LastLogin` DATETIME NOT NULL<br />
)</div>
</div>
</td>
</tr>
</tbody>
</table>
<p align="justify">It is assumed that you have already had an authorization page. Otherwise you can create it using PHP, SSI, and similar languages. There are no major difficulties in writing this program (script).</p>
<p align="justify">Authorization page should work with two tables: one table where information about registered users is stored and the other one where unsuccessful login attempts are listed.<br />
Before verifying entered data, system has to check if the user exceeded attempts limit or not. If in the LoginAttempts table there are more than two records correspondent to one IP address, then error message will appear saying that access is blocked for a certain period of time. You can set time period at your discretion. Depending on your security policy it can vary from 1 minute to 24 hours or more. In the following example access will be blocked for 30 minutes.</p>
<table cellspacing="1">
<tbody>
<tr>
<td id="post-main-8648" valign="top" width="100%">
<div>
<div>&lt;?php<br />
function confirmIPAddress($value) {</p>
<p>$q = &#8220;SELECT attempts, (CASE when lastlogin is not NULL and DATE_ADD(LastLogin, INTERVAL &#8220;.TIME_PERIOD.<br />
&#8221; MINUTE)&gt;NOW() then 1 else 0 end) as Denied FROM &#8220;.TBL_ATTEMPTS.&#8221; WHERE ip = &#8216;$value&#8217;&#8221;;</p>
<p>$result = mysql_query($q, $this-&gt;connection);<br />
$data = mysql_fetch_array($result);</p>
<p>//Verify that at least one login attempt is in database</p>
<p>if (!$data) {<br />
return 0;<br />
}<br />
if ($data["attempts"] &gt;= ATTEMPTS_NUMBER)<br />
{<br />
if($data["Denied"] == 1)<br />
{<br />
return 1;<br />
}<br />
else<br />
{<br />
$this-&gt;clearLoginAttempts($value);<br />
return 0;<br />
}<br />
}<br />
return 0;<br />
}</p>
<p>function addLoginAttempt($value) {</p>
<p>//Increase number of attempts. Set last login attempt if required.</p>
<p>$q = &#8220;SELECT * FROM &#8220;.TBL_ATTEMPTS.&#8221; WHERE ip = &#8216;$value&#8217;&#8221;;<br />
$result = mysql_query($q, $this-&gt;connection);<br />
$data = mysql_fetch_array($result);</p>
<p>if($data)<br />
{<br />
$attempts = $data["attempts"]+1;</p>
<p>if($attempts==3) {<br />
$q = &#8220;UPDATE &#8220;.TBL_ATTEMPTS.&#8221; SET attempts=&#8221;.$attempts.&#8221;, lastlogin=NOW() WHERE ip = &#8216;$value&#8217;&#8221;;<br />
$result = mysql_query($q, $this-&gt;connection);<br />
}<br />
else {<br />
$q = &#8220;UPDATE &#8220;.TBL_ATTEMPTS.&#8221; SET attempts=&#8221;.$attempts.&#8221; WHERE ip = &#8216;$value&#8217;&#8221;;<br />
$result = mysql_query($q, $this-&gt;connection);<br />
}<br />
}<br />
else {<br />
$q = &#8220;INSERT INTO &#8220;.TBL_ATTEMPTS.&#8221; (attempts,IP,lastlogin) values (1, &#8216;$value&#8217;, NOW())&#8221;;<br />
$result = mysql_query($q, $this-&gt;connection);<br />
}<br />
}</p>
<p>function clearLoginAttempts($value) {<br />
$q = &#8220;UPDATE &#8220;.TBL_ATTEMPTS.&#8221; SET attempts = 0 WHERE ip = &#8216;$value&#8217;&#8221;;<br />
return mysql_query($q, $this-&gt;connection);<br />
}<br />
?&gt;</p></div>
</div>
</td>
</tr>
</tbody>
</table>
<p><img src="http://www.webcheatsheet.com/php/images/blocking_system-access_1.gif" alt="" width="757" height="460" border="0" /></p>
<p align="justify">If attempts limit has not been reached, then the system will check, if the data entered are correct. If the data are verified, information about previous attempts is deleted, and for the next authorization user again will have three login attempts.</p>
<p><img src="http://www.webcheatsheet.com/php/images/blocking_system-access_2.gif" alt="" width="757" height="460" border="0" /></p>
<p align="justify">
You can test this login system online or <a href="http://www.webcheatsheet.com/php/login_page/login_page.zip">download</a> completed php scripts and try to use them on your site.</p>
<div id="seo_alrp_related"><h2>Posts Related to Blocking access to the login page after three unsuccessful login attempts</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/ajax-login-validation-php-jquery/" rel="bookmark">Ajax login validation system in PHP using jQuery</a></h3><p>Last time, I’ve showed you how to check user availability in Ajax using jQuery’s fading effect. But I’ve just shown the example without connecting the ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/create-a-csv-file-from-mysql-with-php/" rel="bookmark">Create a CSV file from MySQL with PHP</a></h3><p>There are a couple of ways to export data from MySQL to a CSV file but neither of them supports adding a header row to ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/09/build-a-file-sharing-application-in-cakephp/" rel="bookmark">Build a file sharing application in cakephp</a></h3><p>The honeymoon is over baby. Now it’s time for the real work to begin. This iteration of our CakePHP tutorial series will result in your ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/record-locking-in-web-applications/" rel="bookmark">Record locking in Web applications</a></h3><p>Record locking is used for preventing simultaneous update of the same data and therefore avoiding inconsistent results. A locked record means it is not available ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/paging-using-php-and-mysql/" rel="bookmark">Paging Using PHP and MySQL</a></h3><p>When there's more than one column involved in paging there isn't much that we need to modify. We only need to decide how to count ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/08/blocking-access-to-the-login-page-after-three-unsuccessful-login-attempts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Pass  JavaScript variables to PHP</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-pass-javascript-variables-to-php/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-pass-javascript-variables-to-php/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 17:17:22 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Javascript Interview Questions]]></category>
		<category><![CDATA[Others]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Php interview question]]></category>
		<category><![CDATA[tips and technique]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[SCRIPTS GET]]></category>
		<category><![CDATA[VARIABLES PASSING]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1433</guid>
		<description><![CDATA[JavaScript is mainly used as a client side scripting language, while PHP is a server side technology. Unlike Java or ASP.Net, PHP doesn&#8217;t have tools to make it work client side. That is why you need to combine JavaScript and PHP scripts to develop powerful web-applications. One of the frequent problems is defining visitor’s screen [...]]]></description>
			<content:encoded><![CDATA[<p>JavaScript is mainly used as a client side scripting language, while PHP is a server side technology. Unlike Java or ASP.Net, PHP doesn&#8217;t have tools to make it work client side. That is why you need to combine JavaScript and PHP scripts to develop powerful web-applications.</p>
<p>One of the frequent problems is defining visitor’s screen resolution using JavaScript tools and passing this data to PHP-script. The following script provides solution for this problem:</p>
<table cellspacing="1">
<tbody>
<tr>
<td id="post-main-8648" valign="top" width="100%">
<div>
<div>&lt;script type=&#8221;text/javascript&#8221;&gt;</p>
<p>width = screen.width;<br />
height = screen.height;</p>
<p>if (width &gt; 0 &amp;&amp; height &gt;0) {<br />
window.location.href = &#8220;http://localhost/main.php?width=&#8221; + width + &#8220;&amp;height=&#8221; + height;<br />
} else<br />
exit();</p>
<p>&lt;/script&gt;</p></div>
</div>
</td>
</tr>
</tbody>
</table>
<p>Copy and paste this code snippet in the text editor, save it as index.htm and run it in your browser. After this code has been executed, a user is automatically redirected to the main.php page where screen resolution is displayed in the browser window.</p>
<p>The main.php looks as follows:</p>
<table cellspacing="1">
<tbody>
<tr>
<td id="post-main-8648" valign="top" width="100%">
<div>
<div>&lt;?php<br />
echo &#8220;&lt;h1&gt;Screen Resolution:&lt;/h1&gt;&#8221;;<br />
echo &#8220;Width  : &#8220;.$_GET['width'].&#8221;&lt;br&gt;&#8221;;<br />
echo &#8220;Height : &#8220;.$_GET['height'].&#8221;&lt;br&gt;&#8221;;<br />
?&gt;</div>
</div>
</td>
</tr>
</tbody>
</table>
<p>As you can see, passing JavaScript variables in PHP is similar to sending data using GET method.</p>
<div id="seo_alrp_related"><h2>Posts Related to How to Pass  JavaScript variables to PHP</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/03/how-to-pass-javascript-variable-to-php/" rel="bookmark">how to Pass javascript variable to PHP</a></h3><p>There is lots of way to pass the php script data in javascript like simply echoing php varible in PHP. Yes you can simply echo ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/03/javascript-interview-questions-%e2%80%93-third-part-of-jquery-interview-question/" rel="bookmark">Javascript Interview Questions – Third Part of Jquery Interview question</a></h3><p>How to write a script for “Select” lists using JavaScript? 1. To remove an item from a list set it to null mySelectObject.options[3] = null ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/04/innovative-gateway-api-code-innovative-gateway-integration/" rel="bookmark">Innovative Gateway API CODE  | Innovative Gateway Integration</a></h3><p>Gateway Toolkits Windows API Windows Client Install including MS Installer v1.0.0.5 Windows Client Install including MS Installer v1.0.0.4 Windows Client Objects v1.0.0.4 Windows Client ASP ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/03/javascript-interview-questions-%e2%80%93-second-part-of-jquery-interview-question/" rel="bookmark">Javascript Interview Questions – Second Part of Jquery Interview question</a></h3><p>What is JavaScript? JavaScript is a general-purpose programming language designed to let programmers of all skill levels control the behavior of software objects. The language ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/02/expand-a-textbox-on-focus-using-jquery/" rel="bookmark">Expand a TextBox on Focus using jQuery</a></h3><p>Here’s how to animate and expand the height and width of a TextBox when it receives focus. After a delay, the TextBox returns to its ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-pass-javascript-variables-to-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jquery Mouseover Tooltip Plugin</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/07/jquery-mouseover-tooltip-plugin/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/07/jquery-mouseover-tooltip-plugin/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 18:49:36 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Others]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1405</guid>
		<description><![CDATA[Let&#8217;s review a topic about how to create Jquery Mouseover Tooltip Plugin. Have you ever seen Jquery Mouseover Tooltip Plugin ? &#8230; Like this below: Link Nudging Or, Naruto Image How to do ? &#8230; 1. Go to Dashboard, click Design, click Edit HTML 2. Find code of HTML below: &#60;/head&#62; you can use (Ctrl+F) [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s review a topic about how to create Jquery Mouseover Tooltip Plugin. Have you ever seen Jquery Mouseover Tooltip Plugin ? &#8230;</p>
<p>Like this below:</p>
<p>Link Nudging</p>
<p>Or,</p>
<p>Naruto Image</p>
<p>How to do ? &#8230;<br />
<a name="more"></a><br />
1. Go to Dashboard, click Design, click Edit HTML</p>
<p>2. Find code of HTML below:</p>
<div>&lt;/head&gt;</div>
<p>you can use (Ctrl+F) to find easily</p>
<p>3. Right Before <strong>&lt;/head&gt;</strong> &#8211; place code of HTML below:</p>
<div>&lt;!&#8211;Jquery-Tooltip-BEGIN&#8211;&gt;<br />
&lt;script src=&#8221;jquery.js&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;jquery.hoverIntent.js&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt; &lt;!&#8211; optional &#8211;&gt;<br />
&lt;script src=&#8221;jquery.cluetip.js&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;</p>
<p>&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
$(document).ready(function() {<br />
$(&#8216;a.tips&#8217;).cluetip();</p>
<p>$(&#8216;#houdini&#8217;).cluetip({<br />
splitTitle: &#8216;|&#8217;, // use the invoking element&#8217;s title attribute to populate the clueTip&#8230;<br />
// &#8230;and split the contents into separate divs where there is a &#8220;|&#8221;<br />
showTitle: false // hide the clueTip&#8217;s heading<br />
});<br />
});<br />
&lt;/script&gt;<br />
&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;jquery.cluetip.css&#8221; type=&#8221;text/css&#8221; /&gt;<br />
&lt;!&#8211;Jquery-Tooltip-END-http://tutorialwebforblogger.blogspot.com&#8211;&gt;</p></div>
<p>4. Click Save Template.</p>
<p>5. Example of how to use Jquery Mouseover Tooltip Plugin to other link:</p>
<div>&lt;a href=&#8221;http://tutorialwebforblogger.blogspot.com/2010/03/jquery-link-nudging-plugin.html&#8221; id=&#8221;nudging&#8221; title=&#8221;Click to see how to create jquery link nudging plugin.&#8221;&gt;Link Nudging&lt;/a&gt;</div>
<p>6. Example of how to use Jquery Mouseover Tooltip Plugin to image:</p>
<div>&lt;a href=&#8221;http://2.bp.blogspot.com/_rg7WY6fRQ4M/RtrIBP91cfI/AAAAAAAAATw/2L8EM1m5950/s1600/Naruto%252BWallpaper%252BUzumaki%252BNaruto%252B1.jpg&#8221; id=&#8221;naruto&#8221; title=&#8221;Click to see image of Naruto Uzumaki.&#8221;&gt;Naruto Image&lt;/a&gt;</div>
<p>Done, Now, you&#8217;ve already created Jquery Mouseover Tooltip Plugin.</p>
<div id="seo_alrp_related"><h2>Posts Related to Jquery Mouseover Tooltip Plugin</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/02/add-a-%e2%80%9cread-more%e2%80%9d-link-using-jquery/" rel="bookmark">Add a “Read More” Link using jQuery</a></h3><p>The jQuery Expander Plugin is a simple little jQuery plugin to hide/collapse a portion of an element's text and add a "read more" link so ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/jquery-thumbnail-image-with-heading-and-caption/" rel="bookmark">Jquery Thumbnail Image with Heading and Caption</a></h3><p>Let's review a topic about how to create a Jquery Thumbnail Image with Heading and Caption. Have you ever seen Jquery Thumbnail Image with Heading ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/quick-easy-way-to-implement-drag-n-share-with-jquery/" rel="bookmark">Quick &#038; Easy Way to Implement Drag n Share With jQuery</a></h3><p>You must have seen the drag to share functionality on Mashable that lets visitors share the content on popular social networks intuitively. Just drag one ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/jquery-plugin-word-counter-textarea/" rel="bookmark">jQuery plugin: word-counter for textarea</a></h3><p>Sorry friends on the way of move to new home I’ve been lost from the blog as I didn’t have internet connection for few last ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/02/how-to-create-a-simple-slider-using-jquery/" rel="bookmark">How to Create a Simple Slider Using jQuery</a></h3><p>Did you know what is jquery? Jquery is a cross browser JavaScript library designed to simplify the client-side scripting of HTML. Jquery is free, open ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/07/jquery-mouseover-tooltip-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jquery Thumbnail Image with Heading and Caption</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/07/jquery-thumbnail-image-with-heading-and-caption/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/07/jquery-thumbnail-image-with-heading-and-caption/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 18:48:00 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Others]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1403</guid>
		<description><![CDATA[Let&#8217;s review a topic about how to create a Jquery Thumbnail Image with Heading and Caption. Have you ever seen Jquery Thumbnail Image with Heading and Caption ? &#8230; Like this below: Click Here to See the Example how to create a Jquery Thumbnail Image with Heading and Caption ? &#8230; First Step; 1. Go [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s review a topic about how to create a Jquery Thumbnail Image with Heading and Caption.<br />
Have you ever seen Jquery Thumbnail Image with Heading and Caption ? &#8230;</p>
<p>Like this below:</p>
<p>Click Here to See the Example</p>
<p>how to create a Jquery Thumbnail Image with Heading and Caption ? &#8230;<br />
<a name="more"></a><br />
<strong>First Step;</strong></p>
<p>1. Go to Dashboard, click Design, click Edit HTML</p>
<p>2. Find code of HTML below:</p>
<div>&lt;/head&gt;</div>
<p>you can use (Ctrl+F) to find easily</p>
<p>3. Right Before <strong>&lt;/head&gt; </strong>- place code of HTML below:</p>
<div>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script&gt;$(document).ready(function () {</p>
<p>// transition effect<br />
style = &#8216;easeOutQuart&#8217;;</p>
<p>// if the mouse hover the image<br />
$(&#8216;.photo&#8217;).hover(<br />
function() {<br />
//display heading and caption<br />
$(this).children(&#8216;div:first&#8217;).stop(false,true).animate({top:0},{duration:200, easing: style});<br />
$(this).children(&#8216;div:last&#8217;).stop(false,true).animate({bottom:0},{duration:200, easing: style});<br />
},</p>
<p>function() {<br />
//hide heading and caption<br />
$(this).children(&#8216;div:first&#8217;).stop(false,true).animate({top:-50},{duration:200, easing: style});<br />
$(this).children(&#8216;div:last&#8217;).stop(false,true).animate({bottom:-50},{duration:200, easing: style});<br />
}<br />
);</p>
<p>});&lt;/script&gt;</p></div>
<p>4. Find code of HTML below:</p>
<div> ]]&gt;&lt;/b:skin&gt;</div>
<p>you can use (Ctrl+F) to find easily</p>
<p>5. Right Before <strong> ]]&gt;&lt;/b:skin&gt;</strong> &#8211; place code of HTML below:</p>
<div>&lt;!&#8211;Jquery-Thumbnail-BEGIN&#8211;&gt;<br />
.photo {<br />
/* relative position, so that objects in it can be positioned inside this container */<br />
position:relative;<br />
font-family:arial;<br />
/* hide those extra height that goes beyong the size of this container */<br />
overflow:hidden;<br />
border:5px solid #000;<br />
width:350px;<br />
height:186px;<br />
}<br />
.photo .heading, .photo .caption {<br />
/* position inside the container */<br />
position:absolute;<br />
background:#000;<br />
height:50px;<br />
width:350px;<br />
/* transparency for different browsers */<br />
/* i have shared this in my CSS tips post too */<br />
opacity:0.6;<br />
filter:alpha(opacity=60);<br />
-moz-opacity:0.6;<br />
-khtml-opacity: 0.6;</p>
<p>}<br />
.photo .heading {<br />
/* hide it with negative value */<br />
/* it&#8217;s the height of heading class */<br />
top:-50px;<br />
}</p>
<p>.photo .caption {<br />
/* hide it with negative value */<br />
/* it&#8217;s the height of bottom class */<br />
bottom:-50px;<br />
}</p>
<p>/* styling of the classes*/<br />
.photo .heading span {</p>
<p>color:#26c3e5;<br />
top:-50px;<br />
font-weight:bold;<br />
display:block;<br />
padding:5px 0 0 10px;<br />
}<br />
.photo .caption span{<br />
color:#999;<br />
font-size:12px;<br />
display:block;<br />
padding:5px 10px 0 10px;<br />
}<br />
&lt;!&#8211;Jquery-Thumbnail-END-http://tutorialwebforblogger.blogspot.com&#8211;&gt;</p></div>
<p>6. Click Save Template.</p>
<p><strong>Second Step;</strong></p>
<p>1. Go to Dashboard, click Design, click Add a Gadget</p>
<p>2. Click &#8216;HTML/JavaScript&#8217;</p>
<p>3. Place code of HTML below &#8211; into &#8216;HTML/JavaScript&#8217;</p>
<div>&lt;div&gt;<br />
&lt;div&gt;&lt;span&gt;Blogfuel: Widgets and SEO&lt;/span&gt;&lt;/div&gt;<br />
&lt;img src=&#8221;http://www.cmsnl.com/news/img/fuel_station_gas_nozzle.jpg&#8221; width=&#8221;340px&#8221; height=&#8221;175&#8243; alt=&#8221;" /&gt;<br />
&lt;div&gt;&lt;span&gt;This is Example of Jquery Thumbnail Image with Heading and Caption&lt;/span&gt;&lt;/div&gt;<br />
&lt;/div&gt;</div>
<div id="seo_alrp_related"><h2>Posts Related to Jquery Thumbnail Image with Heading and Caption</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/jquery-mouseover-tooltip-plugin/" rel="bookmark">Jquery Mouseover Tooltip Plugin</a></h3><p>Let's review a topic about how to create Jquery Mouseover Tooltip Plugin. Have you ever seen Jquery Mouseover Tooltip Plugin ? ... Like this below: ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/expandable-collapsible-toggle-pane-jquery/" rel="bookmark">Expand-collapse toggle panel (div) using jquery</a></h3><p>In this post, I’ll show you how easy it is to show expandable and collapsible toggle panel using jQuery. When you click on the heading, ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/how-to-add-sweet-thumbnails-preview-gallery/" rel="bookmark">how to add Sweet Thumbnails Preview Gallery</a></h3><p>The Markup The HTML structure is going to consist of a main container which will have the image wrapper for the big image, the navigation ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/css-and-jquery-tutorial-fancy-apple-style-icon-slide-out-navigation/" rel="bookmark">CSS and jQuery Tutorial: Fancy Apple-Style Icon Slide Out Navigation</a></h3><p>1. The HTML The markup just consists of a div with an unordered list inside. The list elements contain a span for the icon and ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/ife-ifempty-function-with-clearbox-in-cakephp/" rel="bookmark">Ife (ifempty) Function With Clearbox in CakePHP</a></h3><p>I use it in this way. 1 2 3 //If member_image will empty then set 'no-photo.jpg' as default image $thumb_photo = ife($member['Member']['member_image'], $member['Member']['member_image'], "no-photo.jpg"); Optional: ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/07/jquery-thumbnail-image-with-heading-and-caption/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sliding Letters with jQuery</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/07/sliding-letters-with-jquery/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/07/sliding-letters-with-jquery/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 18:46:50 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Others]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1401</guid>
		<description><![CDATA[Example In the following we will go through an example and we’ll start by the html for a little menu: 1 &#60;div class="sl_examples"&#62; 2     &#60;a href="#" id="example1" data-hover="Creativity"&#62;Illustrations&#60;/a&#62; 3 &#60;/div&#62; We will use data-hover to indicate the word that should appear on hover. If you don’t use the data-hover then the same word will be [...]]]></description>
			<content:encoded><![CDATA[<h3>Example</h3>
<p>In the following we will go through an example and we’ll start by the html for a little menu:</p>
<div id="highlighter_684372">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&lt;</code><code>div</code> <code>class</code><code>=</code><code>"sl_examples"</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>    </code><code>&lt;</code><code>a</code> <code>href</code><code>=</code><code>"#"</code> <code>id</code><code>=</code><code>"example1"</code> <code>data-hover</code><code>=</code><code>"Creativity"</code><code>&gt;Illustrations&lt;/</code><code>a</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>&lt;/</code><code>div</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>We will use data-hover to indicate the word that should appear on hover. If you don’t use the data-hover then the same word will be used on hover.<br />
Then we will style it in the following way, making sure that we have the right properties for the structure that will be generated:</p>
<div id="highlighter_288362">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>01</code></td>
<td><code>.sl_examples{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>02</code></td>
<td><code>    </code><code>float</code><code>:</code><code>left</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>03</code></td>
<td><code>    </code><code>font-family</code><code>: </code><code>'Bevan'</code><code>, </code><code>arial</code><code>, </code><code>serif</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>04</code></td>
<td><code>    </code><code>font-size</code><code>:</code><code>50px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>05</code></td>
<td><code>    </code><code>line-height</code><code>:</code><code>50px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>06</code></td>
<td><code>    </code><code>color</code><code>:</code><code>#f0f0f0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>07</code></td>
<td><code>    </code><code>margin-right</code><code>:</code><code>5px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>08</code></td>
<td><code>    </code><code>text-transform</code><code>:</code><code>uppercase</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>09</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>.sl_examples a{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code>    </code><code>display</code><code>:</code><code>block</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>12</code></td>
<td><code>    </code><code>position</code><code>:</code><code>relative</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>13</code></td>
<td><code>    </code><code>float</code><code>:</code><code>left</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>14</code></td>
<td><code>    </code><code>clear</code><code>:</code><code>both</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>15</code></td>
<td><code>    </code><code>color</code><code>:</code><code>#fff</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>16</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>17</code></td>
<td><code>.sl_examples a &gt; span{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>18</code></td>
<td><code>    </code><code>height</code><code>:</code><code>50px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>19</code></td>
<td><code>    </code><code>float</code><code>:</code><code>left</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>20</code></td>
<td><code>    </code><code>position</code><code>:</code><code>relative</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>21</code></td>
<td><code>    </code><code>overflow</code><code>:</code><code>hidden</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>22</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>23</code></td>
<td><code>.sl_examples a span span{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>24</code></td>
<td><code>    </code><code>position</code><code>:</code><code>absolute</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>25</code></td>
<td><code>    </code><code>display</code><code>:</code><code>block</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>26</code></td>
<td><code>    </code><code>left</code><code>:</code><code>0px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>27</code></td>
<td><code>    </code><code>top</code><code>:</code><code>0px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>28</code></td>
<td><code>    </code><code>text-align</code><code>:</code><code>center</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>29</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>30</code></td>
<td><code>.sl_examples a span span.sl-w</code><code>1</code><code>{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>31</code></td>
<td><code>    </code><code>color</code><code>:</code><code>#fff</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>32</code></td>
<td><code>    </code><code>text-shadow</code><code>:</code><code>0px</code> <code>0px</code> <code>1px</code> <code>#fff</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>33</code></td>
<td><code>    </code><code>z-index</code><code>:</code><code>2</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>34</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>35</code></td>
<td><code>.sl_examples a span span.sl-w</code><code>2</code><code>{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>36</code></td>
<td><code>    </code><code>color</code><code>:</code><code>#e82760</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>37</code></td>
<td><code>    </code><code>text-shadow</code><code>:</code><code>-1px</code> <code>1px</code> <code>2px</code> <code>#9f0633</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>38</code></td>
<td><code>    </code><code>z-index</code><code>:</code><code>3</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>39</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>So, “sl-w1″ is the class for the first word letters and “sl-w2″ is the class for the second word letters.</p>
<p>Finally, we call the plugin:</p>
<div id="highlighter_119201">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>$(window).load(</code><code>function</code><code>(){</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>    </code><code>$(</code><code>'#example1'</code><code>).hoverwords({ delay:50 });</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>});</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>The following settings can be used:</p>
<div id="highlighter_446859">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>delay       : </code><code>false</code><code>,        </code><code>// each letter will have different animation times</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>speed       : 300,          </code><code>// animation speed</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>easing      : </code><code>'jswing'</code><code>,     </code><code>// easing animation</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>dir         : </code><code>'leftright'</code><code>,  </code><code>// leftright - current goes left, new one goes right || rightleft - current goes right, new one goes left,</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>overlay     : </code><code>false</code><code>,        </code><code>// hover word is slided on top of the current word (just for the case when the hover word equals word)</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>opacity     : </code><code>true</code>          <code>// animate the letters opacity</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>We hope you liked this little experiment and find it useful!</p>
<p><a href="http://tympanus.net/Development/SlidingLetters/" target="_blank">Download source</a></p>
<div><ins><ins id="aswift_0_anchor"><br />
</ins></ins></div>
<div id="seo_alrp_related"><h2>Posts Related to Sliding Letters with jQuery</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/jquery-plugin-word-counter-textarea/" rel="bookmark">jQuery plugin: word-counter for textarea</a></h3><p>Sorry friends on the way of move to new home I’ve been lost from the blog as I didn’t have internet connection for few last ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/jquery-thumbnail-image-with-heading-and-caption/" rel="bookmark">Jquery Thumbnail Image with Heading and Caption</a></h3><p>Let's review a topic about how to create a Jquery Thumbnail Image with Heading and Caption. Have you ever seen Jquery Thumbnail Image with Heading ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/css-and-jquery-tutorial-fancy-apple-style-icon-slide-out-navigation/" rel="bookmark">CSS and jQuery Tutorial: Fancy Apple-Style Icon Slide Out Navigation</a></h3><p>1. The HTML The markup just consists of a div with an unordered list inside. The list elements contain a span for the icon and ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/sleek-and-smooth-animated-menu-jquery/" rel="bookmark">Sleek and Smooth animated menu using jQuery</a></h3><p>Today, I’m going to show you something interesting with jQuery. Yesterday I was thinking something to post something programming related stuff  in blog after long ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/all-fixed-fade-out-menu-a-css-and-jquery-tutorial/" rel="bookmark">all Fixed Fade Out Menu: A CSS and jQuery Tutorial</a></h3><p>1. The HTML The markup is pretty simple: we have a div with a list inside. The list items will be our links, the search ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/07/sliding-letters-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS and jQuery Tutorial: Fancy Apple-Style Icon Slide Out Navigation</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/07/css-and-jquery-tutorial-fancy-apple-style-icon-slide-out-navigation/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/07/css-and-jquery-tutorial-fancy-apple-style-icon-slide-out-navigation/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 18:45:56 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Others]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1399</guid>
		<description><![CDATA[1. The HTML The markup just consists of a div with an unordered list inside. The list elements contain a span for the icon and the link element: 01 &#60;div class="navigation"&#62; 02  &#60;ul class="menu" id="menu"&#62; 03     &#60;li&#62;&#60;span class="ipod"&#62;&#60;/span&#62;&#60;a href="" class="first"&#62;Players&#60;/a&#62;&#60;/li&#62; 04     &#60;li&#62;&#60;span class="video_camera"&#62;&#60;/span&#62;&#60;a href=""&#62;Cameras&#60;/a&#62;&#60;/li&#62; 05     &#60;li&#62;&#60;span class="television"&#62;&#60;/span&#62;&#60;a href=""&#62;TVs&#60;/a&#62;&#60;/li&#62; 06     &#60;li&#62;&#60;span class="monitor"&#62;&#60;/span&#62;&#60;a href=""&#62;Screens&#60;/a&#62;&#60;/li&#62; 07     &#60;li&#62;&#60;span class="toolbox"&#62;&#60;/span&#62;&#60;a [...]]]></description>
			<content:encoded><![CDATA[<h3>1. The HTML</h3>
<p>The markup just consists of a div with an unordered list inside. The list elements contain a span for the icon and the link element:</p>
<div id="highlighter_268063">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>01</code></td>
<td><code>&lt;</code><code>div</code> <code>class</code><code>=</code><code>"navigation"</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>02</code></td>
<td><code> </code><code>&lt;</code><code>ul</code> <code>class</code><code>=</code><code>"menu"</code> <code>id</code><code>=</code><code>"menu"</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>03</code></td>
<td><code>    </code><code>&lt;</code><code>li</code><code>&gt;&lt;</code><code>span</code> <code>class</code><code>=</code><code>"ipod"</code><code>&gt;&lt;/</code><code>span</code><code>&gt;&lt;</code><code>a</code> <code>href</code><code>=</code><code>""</code> <code>class</code><code>=</code><code>"first"</code><code>&gt;Players&lt;/</code><code>a</code><code>&gt;&lt;/</code><code>li</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>04</code></td>
<td><code>    </code><code>&lt;</code><code>li</code><code>&gt;&lt;</code><code>span</code> <code>class</code><code>=</code><code>"video_camera"</code><code>&gt;&lt;/</code><code>span</code><code>&gt;&lt;</code><code>a</code> <code>href</code><code>=</code><code>""</code><code>&gt;Cameras&lt;/</code><code>a</code><code>&gt;&lt;/</code><code>li</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>05</code></td>
<td><code>    </code><code>&lt;</code><code>li</code><code>&gt;&lt;</code><code>span</code> <code>class</code><code>=</code><code>"television"</code><code>&gt;&lt;/</code><code>span</code><code>&gt;&lt;</code><code>a</code> <code>href</code><code>=</code><code>""</code><code>&gt;TVs&lt;/</code><code>a</code><code>&gt;&lt;/</code><code>li</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>06</code></td>
<td><code>    </code><code>&lt;</code><code>li</code><code>&gt;&lt;</code><code>span</code> <code>class</code><code>=</code><code>"monitor"</code><code>&gt;&lt;/</code><code>span</code><code>&gt;&lt;</code><code>a</code> <code>href</code><code>=</code><code>""</code><code>&gt;Screens&lt;/</code><code>a</code><code>&gt;&lt;/</code><code>li</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>07</code></td>
<td><code>    </code><code>&lt;</code><code>li</code><code>&gt;&lt;</code><code>span</code> <code>class</code><code>=</code><code>"toolbox"</code><code>&gt;&lt;/</code><code>span</code><code>&gt;&lt;</code><code>a</code> <code>href</code><code>=</code><code>""</code><code>&gt;Tools&lt;/</code><code>a</code><code>&gt;&lt;/</code><code>li</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>08</code></td>
<td><code>    </code><code>&lt;</code><code>li</code><code>&gt;&lt;</code><code>span</code> <code>class</code><code>=</code><code>"telephone"</code><code>&gt;&lt;/</code><code>span</code><code>&gt;&lt;</code><code>a</code> <code>href</code><code>=</code><code>""</code><code>&gt;Phones&lt;/</code><code>a</code><code>&gt;&lt;/</code><code>li</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>09</code></td>
<td><code>    </code><code>&lt;</code><code>li</code><code>&gt;&lt;</code><code>span</code> <code>class</code><code>=</code><code>"print"</code><code>&gt;&lt;/</code><code>span</code><code>&gt;&lt;</code><code>a</code> <code>href</code><code>=</code><code>""</code> <code>class</code><code>=</code><code>"last"</code><code>&gt;Printers&lt;/</code><code>a</code><code>&gt;&lt;/</code><code>li</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code> </code><code>&lt;/</code><code>ul</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code>&lt;/</code><code>div</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<h3>2. The CSS</h3>
<p>The style of the navigation container and the unordered list will be the following:</p>
<div id="highlighter_317164">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>01</code></td>
<td><code>.navigation{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>02</code></td>
<td><code>    </code><code>position</code><code>:</code><code>relative</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>03</code></td>
<td><code>    </code><code>margin</code><code>:</code><code>0</code> <code>auto</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>04</code></td>
<td><code>    </code><code>width</code><code>:</code><code>915px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>05</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>06</code></td>
<td><code>ul.menu{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>07</code></td>
<td><code>    </code><code>list-style</code><code>:</code><code>none</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>08</code></td>
<td><code>    </code><code>font-family</code><code>:</code><code>"Verdana"</code><code>,</code><code>sans-serif</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>09</code></td>
<td><code>    </code><code>border-top</code><code>:</code><code>1px</code> <code>solid</code> <code>#bebebe</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>    </code><code>margin</code><code>:</code><code>0px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code>    </code><code>padding</code><code>:</code><code>0px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>12</code></td>
<td><code>    </code><code>float</code><code>:</code><code>left</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>13</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>14</code></td>
<td><code>ul.menu li{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>15</code></td>
<td><code>    </code><code>float</code><code>:</code><code>left</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>16</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>Since we are making the list float, we will need some relative wrapper for the icons. You see, the icons which will be the background-images of the spans in our list, will have absolute positioning. That comes handy when you need to define a z-index, i.e. saying that some element is on top or under another one. Since we want the icons to appear on top and then dissapear under the link element, we will have to deal with z-indeces. And absolute positioning of elements in a relative container will makes things easier.</p>
<p>Now, let’s define the style for the link elements:</p>
<div id="highlighter_173548">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>01</code></td>
<td><code>ul.menu li a{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>02</code></td>
<td><code>    </code><code>text-decoration</code><code>:</code><code>none</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>03</code></td>
<td><code>    </code><code>background</code><code>:</code><code>#7E7E7E</code> <code>url</code><code>(../images/bgMenu.png) </code><code>repeat-x</code> <code>top</code> <code>left</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>04</code></td>
<td><code>    </code><code>padding</code><code>:</code><code>15px</code> <code>0px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>05</code></td>
<td><code>    </code><code>width</code><code>:</code><code>128px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>06</code></td>
<td><code>    </code><code>color</code><code>:</code><code>#333333</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>07</code></td>
<td><code>    </code><code>float</code><code>:</code><code>left</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>08</code></td>
<td><code>    </code><code>text-align</code><code>:</code><code>center</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>09</code></td>
<td><code>    </code><code>border-right</code><code>:</code><code>1px</code> <code>solid</code> <code>#a1a1a1</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>    </code><code>border-left</code><code>:</code><code>1px</code> <code>solid</code> <code>#e8e8e8</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code>    </code><code>font-weight</code><code>:</code><code>bold</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>12</code></td>
<td><code>    </code><code>font-size</code><code>:</code><code>13px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>13</code></td>
<td><code>    </code><code>-moz-</code><code>box-shadow</code><code>: </code><code>0</code> <code>1px</code> <code>3px</code> <code>#555</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>14</code></td>
<td><code>    </code><code>-webkit-</code><code>box-shadow</code><code>: </code><code>0</code> <code>1px</code> <code>3px</code> <code>#555</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>15</code></td>
<td><code>    </code><code>text-shadow</code><code>: </code><code>0</code> <code>1px</code> <code>1px</code> <code>#fff</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>16</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>We want to give the link elements a fixed width and some background gradient. The borders will create a nice inset effect.</p>
<p>The next hover class will be applied using jQuery, since the :hover pseudo class creates an unwanted effect: When the icon slides out it covers the link for a few milliseconds, making the hover style dissapear in that time. That is perceived as a flicker and we will avoid that by defining a class that we will simply add with jQuery when we do the icon slide out effect:</p>
<div id="highlighter_800664">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>ul.menu li a.hover{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>    </code><code>background-image</code><code>:</code><code>none</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>    </code><code>color</code><code>:</code><code>#fff</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>    </code><code>text-shadow</code><code>: </code><code>0</code> <code>-1px</code> <code>1px</code> <code>#000</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>The first and last link element should have a rounded border on the respective side, so we define two classes for those:</p>
<div id="highlighter_767494">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>ul.menu li a.first{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>    </code><code>-moz-border-radius:</code><code>0px</code> <code>0px</code> <code>0px</code> <code>10px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>    </code><code>-webkit-border-bottom-left-radius: </code><code>10px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>    </code><code>border-left</code><code>:</code><code>none</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>ul.menu li a.last{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>7</code></td>
<td><code>    </code><code>-moz-border-radius:</code><code>0px</code> <code>0px</code> <code>10px</code> <code>0px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>8</code></td>
<td><code>    </code><code>-webkit-border-bottom-right-radius: </code><code>10px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>9</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>The common style for all the icon spans will be the following:</p>
<div id="highlighter_956365">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>01</code></td>
<td><code>ul.menu li span{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>02</code></td>
<td><code>    </code><code>width</code><code>:</code><code>64px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>03</code></td>
<td><code>    </code><code>height</code><code>:</code><code>64px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>04</code></td>
<td><code>    </code><code>background-repeat</code><code>:</code><code>no-repeat</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>05</code></td>
<td><code>    </code><code>background-color</code><code>:</code><code>transparent</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>06</code></td>
<td><code>    </code><code>position</code><code>:</code><code>absolute</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>07</code></td>
<td><code>    </code><code>z-index</code><code>:</code><code>-1</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>08</code></td>
<td><code>    </code><code>top</code><code>:</code><code>80px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>09</code></td>
<td><code>    </code><code>cursor</code><code>:</code><code>pointer</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>The single styles for the specific icons will contain the background-image and the x-position:</p>
<div id="highlighter_462772">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>01</code></td>
<td><code>ul.menu li span.ipod{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>02</code></td>
<td><code>    </code><code>background-image</code><code>:</code><code>url</code><code>(../icons/ipod.png);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>03</code></td>
<td><code>    </code><code>left</code><code>:</code><code>33px</code><code>; </code><code>/*128/2 - 32(half of icon) +1 of border*/</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>04</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>05</code></td>
<td><code>ul.menu li span.video_camera{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>06</code></td>
<td><code>    </code><code>background-image</code><code>:</code><code>url</code><code>(../icons/video_camera.png);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>07</code></td>
<td><code>    </code><code>left</code><code>:</code><code>163px</code><code>; </code><code>/* plus 128 + 2px of border*/</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>08</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>09</code></td>
<td><code>ul.menu li span.television{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>    </code><code>background-image</code><code>:</code><code>url</code><code>(../icons/television.png);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code>    </code><code>left</code><code>:</code><code>293px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>12</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>13</code></td>
<td><code>ul.menu li span.monitor{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>14</code></td>
<td><code>    </code><code>background-image</code><code>:</code><code>url</code><code>(../icons/monitor.png);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>15</code></td>
<td><code>    </code><code>left</code><code>:</code><code>423px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>16</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>17</code></td>
<td><code>ul.menu li span.toolbox{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>18</code></td>
<td><code>    </code><code>background-image</code><code>:</code><code>url</code><code>(../icons/toolbox.png);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>19</code></td>
<td><code>    </code><code>left</code><code>:</code><code>553px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>20</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>21</code></td>
<td><code>ul.menu li span.telephone{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>22</code></td>
<td><code>    </code><code>background-image</code><code>:</code><code>url</code><code>(../icons/telephone.png);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>23</code></td>
<td><code>    </code><code>left</code><code>:</code><code>683px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>24</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>25</code></td>
<td><code>ul.menu li span.</code><code>print</code><code>{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>26</code></td>
<td><code>    </code><code>background-image</code><code>:</code><code>url</code><code>(../icons/</code><code>print</code><code>.png);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>27</code></td>
<td><code>    </code><code>left</code><code>:</code><code>813px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>28</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>As you can see, we are positioning the icons in such a way, that they are centered inside of the list element. The top position is 80px initially since we want to show them to the user when the page get’s loaded. Then we will hide them in a stair-like fashion to create an awesome effect!</p>
<h3>3. The JavaScript</h3>
<p>First, we want to create the effect of the icons dissapearing in a stair-like fashion and then we will define the hover function for the list elements:</p>
<div id="highlighter_35945">
<div>
<div>
<table>
<tbody>
<tr>
<td><code>01</code></td>
<td><code>$(</code><code>function</code><code>() {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>02</code></td>
<td><code>    </code><code>var</code> <code>d=1000;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>03</code></td>
<td><code>    </code><code>$(</code><code>'#menu span'</code><code>).each(</code><code>function</code><code>(){</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>04</code></td>
<td><code>        </code><code>$(</code><code>this</code><code>).stop().animate({</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>05</code></td>
<td><code>            </code><code>'top'</code><code>:</code><code>'-17px'</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>06</code></td>
<td><code>        </code><code>},d+=250);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>07</code></td>
<td><code>    </code><code>});</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>08</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>09</code></td>
<td><code>    </code><code>$(</code><code>'#menu &gt; li'</code><code>).hover(</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>        </code><code>function</code> <code>() {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code>            </code><code>var</code> <code>$</code><code>this</code> <code>= $(</code><code>this</code><code>);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>12</code></td>
<td><code>            </code><code>$(</code><code>'a'</code><code>,$</code><code>this</code><code>).addClass(</code><code>'hover'</code><code>);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>13</code></td>
<td><code>            </code><code>$(</code><code>'span'</code><code>,$</code><code>this</code><code>).stop().animate({</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>14</code></td>
<td><code>                </code><code>'top'</code><code>:</code><code>'40px'</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>15</code></td>
<td><code>            </code><code>},300).css({</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>16</code></td>
<td><code>                </code><code>'zIndex'</code><code>:</code><code>'10'</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>17</code></td>
<td><code>            </code><code>});</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>18</code></td>
<td><code>        </code><code>},</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>19</code></td>
<td><code>        </code><code>function</code> <code>() {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>20</code></td>
<td><code>            </code><code>var</code> <code>$</code><code>this</code> <code>= $(</code><code>this</code><code>);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>21</code></td>
<td><code>            </code><code>$(</code><code>'a'</code><code>,$</code><code>this</code><code>).removeClass(</code><code>'hover'</code><code>);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>22</code></td>
<td><code>            </code><code>$(</code><code>'span'</code><code>,$</code><code>this</code><code>).stop().animate({</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>23</code></td>
<td><code>                </code><code>'top'</code><code>:</code><code>'-17px'</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>24</code></td>
<td><code>            </code><code>},800).css({</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>25</code></td>
<td><code>                </code><code>'zIndex'</code><code>:</code><code>'-1'</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>26</code></td>
<td><code>            </code><code>});</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>27</code></td>
<td><code>        </code><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>28</code></td>
<td><code>    </code><code>);</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>29</code></td>
<td><code>});</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>When hovering, we add the class “hover” to the link element, make the icon appear from the top, and increase the z-Index, so that the icon stays on top of the link. When the mouse goes out, we do exactly the opposite, which creates the effect that the icon dissapears behind the link element. For that we will allow more time (800 milliseconds) because it’s such a fun effect that the user might want to enjoy a little bit!</p>
<p>And that’s all!<br />
I hope you like and enjoy it!</p>
<p>D<a href="http://www.tympanus.net/Tutorials/FancyAppleStyleNavigation/FancyAppleStyleNavigation.zip">ownload source</a></p>
<p>&nbsp;</p>
<div id="seo_alrp_related"><h2>Posts Related to CSS and jQuery Tutorial: Fancy Apple-Style Icon Slide Out Navigation</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/all-fixed-fade-out-menu-a-css-and-jquery-tutorial/" rel="bookmark">all Fixed Fade Out Menu: A CSS and jQuery Tutorial</a></h3><p>1. The HTML The markup is pretty simple: we have a div with a list inside. The list items will be our links, the search ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/how-to-add-beautiful-slide-out-navigation-a-css-and-jquery-tutorial/" rel="bookmark">how to add Beautiful Slide Out Navigation: A CSS and jQuery Tutorial</a></h3><p>1. The HTML Structure The only thing we will need for the navigation is a simple unordered list with links inside of the list elements: ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/sleek-and-smooth-animated-menu-jquery/" rel="bookmark">Sleek and Smooth animated menu using jQuery</a></h3><p>Today, I’m going to show you something interesting with jQuery. Yesterday I was thinking something to post something programming related stuff  in blog after long ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/how-to-add-sweet-thumbnails-preview-gallery/" rel="bookmark">how to add Sweet Thumbnails Preview Gallery</a></h3><p>The Markup The HTML structure is going to consist of a main container which will have the image wrapper for the big image, the navigation ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/color-palette-generator-using-jqueryas-i-continue-to-learn-jquery-i-think-its-important-that-i-begin-by-porting-over-scripts-ive-created-using-mootools-one-of-those-scripts-is-my-color-palette-g/" rel="bookmark">Color Palette Generator Using jQueryAs I continue to learn jQuery, I think it&#8217;s important that I begin by porting over scripts I&#8217;ve created using MooTools. One of those scripts is my Color Palette Generator script, which debuted on Eric Wendelin&#8217;s blog. For those of you that missed it, my script analyzes all of the colors on the page (minus images) and builds a palette of colors. Here it is in some jQuery goodness.  The XHTML  <input type="button" id="get-colors" value="Get Colors" class="button" /> <div id="colors-wrapper"></div>  All we need to begin with is the button that triggers the palette generation and a DIV container that will hold all of the DIVs my jQuery creates. The CSS  .dcolor { height:40px; } .dtext {  } .dwrapper { width:200px; float:left; padding:10px; margin:0 20px 20px 0; border:1px solid #ccc; }   These CSS classes act as containers for the text DIV I generate and the color-displaying DIV I generate. Those two DIVs are held in one wrapping DIV. The jQuery JavaScript  /* when the dom is ready */ $(document).ready(function() { $(&#8216;#get-colors&#8217;).click(function() {   //my colors array var colors = new Array(); //get all elements $(&#8216;*&#8217;).each(function() { if($(this).css(&#8216;background-color&#8217;) &#038;&#038; $(this).css(&#8216;background-color&#8217;) != &#8216;transparent&#8217;) { colors.push($(this).css(&#8216;background-color&#8217;)); } if($(this).css(&#8216;color&#8217;)) { colors.push($(this).css(&#8216;color&#8217;)); } if($(this).css(&#8216;border-color&#8217;)) { colors.push($(this).css(&#8216;border-color&#8217;)); } }); //remove dupes and sort colors.sort(); //create a color block for all of them jQuery.each(colors,function(it,value) { if(!$(&#8216;div[rel=\'' + value + '\']&#8216;).length) { //inject the wrapper var wrapper_id = &#8216;w&#8217; + it; $(&#8216;<div class="dwrapper" id="' + wrapper_id + '" rel="' + value + '"> </div>&#8216;).appendTo(&#8216;#colors-wrapper&#8217;); //inject the color div $(&#8216;<div class="dcolor" style="background-color:' + value + '"> </div>&#8216;).appendTo(&#8216;#&#8217; + wrapper_id); //inject text div $(&#8216;<div class="text">&#8216; + value + &#8216;</div>&#8216;).appendTo(&#8216;#&#8217; + wrapper_id); } }); }); });   When someone clicks the &#8220;Get Colors&#8221; button, I grab every element in the DOM and collect its color, background-color, and border-color. Once I&#8217;ve cycled through all of the elements, cycle through all of the colors and display them as DIVs inside my colors-wrapper element. You&#8217;ll note that I utilized therel attribute to prevent duplicates.</a></h3><p>As I continue to learn jQuery, I think it's important that I begin by porting over scripts I've created using MooTools. One of those scripts ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/07/css-and-jquery-tutorial-fancy-apple-style-icon-slide-out-navigation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jPaginate: how to add a Fancy jQuery Pagination Plugin</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/07/jpaginate-how-to-add-a-fancy-jquery-pagination-plugin/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/07/jpaginate-how-to-add-a-fancy-jquery-pagination-plugin/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 18:44:44 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Others]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1397</guid>
		<description><![CDATA[jPaginate is a jQuery pagination plugin that comes with a twist: animated page numbers. The user can slide through the available page numbers by clicking or just hovering over the arrows. Shortlinks to the first and last page are available as well. You can call the plugin in the following way: &#160; $(elementID).paginate() You can [...]]]></description>
			<content:encoded><![CDATA[<p><img title="jPaginate" src="http://tympanus.net/codrops/wp-content/uploads/2009/11/jPaginate.png" alt="jPaginate" width="540" height="164" /></p>
<p>jPaginate is a jQuery pagination plugin that comes with a twist: animated page numbers. The user can slide through the available page numbers by clicking or just hovering over the arrows. Shortlinks to the first and last page are available as well.<br />
You can call the plugin in the following way:</p>
<p>&nbsp;</p>
<p><code>$(elementID).paginate()</code></p>
<p>You can configure the plugin with the following properties:</p>
<ol>
<li><strong>count</strong>: The total number of pages</li>
<li><strong>start</strong>: With which number the visible pages should start</li>
<li><strong>display</strong>: How many page numbers should be visible</li>
<li><strong>border</strong>: If there should be a border (true/false)</li>
<li><strong>border_color</strong>: Color of the border</li>
<li><strong>text_color</strong>: Color of the text/numbers</li>
<li><strong>background_color</strong>: Background color</li>
<li><strong>border_hover_color</strong>: Border color when hovering</li>
<li><strong>text_hover_color</strong>: Text color when hovering</li>
<li><strong>background_hover_color</strong>: Background color when hovering</li>
<li><strong>images</strong>: If the arrows should be images or not (true/false)</li>
<li><strong>mouse</strong>: With value “press” the user can keep the mouse button pressed and the page numbers will keep on sliding. With value “slide” the page numbers will slide once with each click.</li>
<li><strong>onChange</strong>: The callback function when clicking on a page. As argument the number of the page clicked can be used.</li>
</ol>
<p><a href="http://tympanus.net/jPaginate/jPaginate.zip">Download jPaginate</a></p>
<div></div>
<div id="seo_alrp_related"><h2>Posts Related to jPaginate: how to add a Fancy jQuery Pagination Plugin</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/how-to-add-beautiful-slide-out-navigation-a-css-and-jquery-tutorial/" rel="bookmark">how to add Beautiful Slide Out Navigation: A CSS and jQuery Tutorial</a></h3><p>1. The HTML Structure The only thing we will need for the navigation is a simple unordered list with links inside of the list elements: ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/twitter-api-and-jquery-showcase-display-your-followers-or-friends/" rel="bookmark">Twitter API and jQuery Showcase: Display your Followers or Friends</a></h3><p>Today I was playing around with the Twitter API and created this little “widget” using jQuery and PHP. I know, there are already plenty of ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/07/all-fixed-fade-out-menu-a-css-and-jquery-tutorial/" rel="bookmark">all Fixed Fade Out Menu: A CSS and jQuery Tutorial</a></h3><p>1. The HTML The markup is pretty simple: we have a div with a list inside. The list items will be our links, the search ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/color-palette-generator-using-jqueryas-i-continue-to-learn-jquery-i-think-its-important-that-i-begin-by-porting-over-scripts-ive-created-using-mootools-one-of-those-scripts-is-my-color-palette-g/" rel="bookmark">Color Palette Generator Using jQueryAs I continue to learn jQuery, I think it&#8217;s important that I begin by porting over scripts I&#8217;ve created using MooTools. One of those scripts is my Color Palette Generator script, which debuted on Eric Wendelin&#8217;s blog. For those of you that missed it, my script analyzes all of the colors on the page (minus images) and builds a palette of colors. Here it is in some jQuery goodness.  The XHTML  <input type="button" id="get-colors" value="Get Colors" class="button" /> <div id="colors-wrapper"></div>  All we need to begin with is the button that triggers the palette generation and a DIV container that will hold all of the DIVs my jQuery creates. The CSS  .dcolor { height:40px; } .dtext {  } .dwrapper { width:200px; float:left; padding:10px; margin:0 20px 20px 0; border:1px solid #ccc; }   These CSS classes act as containers for the text DIV I generate and the color-displaying DIV I generate. Those two DIVs are held in one wrapping DIV. The jQuery JavaScript  /* when the dom is ready */ $(document).ready(function() { $(&#8216;#get-colors&#8217;).click(function() {   //my colors array var colors = new Array(); //get all elements $(&#8216;*&#8217;).each(function() { if($(this).css(&#8216;background-color&#8217;) &#038;&#038; $(this).css(&#8216;background-color&#8217;) != &#8216;transparent&#8217;) { colors.push($(this).css(&#8216;background-color&#8217;)); } if($(this).css(&#8216;color&#8217;)) { colors.push($(this).css(&#8216;color&#8217;)); } if($(this).css(&#8216;border-color&#8217;)) { colors.push($(this).css(&#8216;border-color&#8217;)); } }); //remove dupes and sort colors.sort(); //create a color block for all of them jQuery.each(colors,function(it,value) { if(!$(&#8216;div[rel=\'' + value + '\']&#8216;).length) { //inject the wrapper var wrapper_id = &#8216;w&#8217; + it; $(&#8216;<div class="dwrapper" id="' + wrapper_id + '" rel="' + value + '"> </div>&#8216;).appendTo(&#8216;#colors-wrapper&#8217;); //inject the color div $(&#8216;<div class="dcolor" style="background-color:' + value + '"> </div>&#8216;).appendTo(&#8216;#&#8217; + wrapper_id); //inject text div $(&#8216;<div class="text">&#8216; + value + &#8216;</div>&#8216;).appendTo(&#8216;#&#8217; + wrapper_id); } }); }); });   When someone clicks the &#8220;Get Colors&#8221; button, I grab every element in the DOM and collect its color, background-color, and border-color. Once I&#8217;ve cycled through all of the elements, cycle through all of the colors and display them as DIVs inside my colors-wrapper element. You&#8217;ll note that I utilized therel attribute to prevent duplicates.</a></h3><p>As I continue to learn jQuery, I think it's important that I begin by porting over scripts I've created using MooTools. One of those scripts ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/02/change-background-color-of-gridview-cell-using-jquery/" rel="bookmark">Change Background Color of GridView Cell using jQuery</a></h3><p>Users often ask how to change the background color of an ASP.NET GridView cell, if the cell matches a condition. It’s actually quite simple using ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/07/jpaginate-how-to-add-a-fancy-jquery-pagination-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

