<?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>Webstuffshare - Learn and share. The simplest harmony. &#187; Menu</title>
	<atom:link href="http://www.webstuffshare.com/tag/menu/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webstuffshare.com</link>
	<description>Learn and share. The simplest harmony.</description>
	<lastBuildDate>Tue, 04 Oct 2011 02:11:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>[CodeSnippet] CSS3 Flying Menu</title>
		<link>http://www.webstuffshare.com/2010/06/codesnippet-css3-flying-menu/</link>
		<comments>http://www.webstuffshare.com/2010/06/codesnippet-css3-flying-menu/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 13:41:28 +0000</pubDate>
		<dc:creator>Hidayat Sagita</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Code Snippet]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Menu]]></category>

		<guid isPermaLink="false">http://www.webstuffshare.com/?p=2193</guid>
		<description><![CDATA[This is a request post from my reader. He asks me how to create a simple menu that have a flying effect when user hovering them using only CSS. As [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.webstuffshare.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/2193.jpg&amp;w=200&amp;h=150&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p>This is a request post from my reader. He asks me how to create a simple menu that have a flying effect when user hovering them using only CSS. As we know CSS3 is more powerful with its transition property, it help us creating animation without any JavaScript or even Flash help. We&#8217;ll use them for creating the flying effect and here is the result. Enjoy!<br />
<span id="more-2193"></span></p>
<div class="button-show-implementation"><a href="http://webstuffshare.com/demo/CSSFlyMenu/">Show Implementation</a></div>
<div class="button-download-source"><a href="http://www.webstuffshare.com/download/CSSFlyMenu.zip">Download Source</a></div>
<div class="cleaner"></div>
<p>Firstly, we need to create list menu using unordered list element :</p>
<pre name="code" class="html">/* Sample #1 */
<ul id="fly-menu">
<li>
		<a href="http://www.webstuffshare.com">
			<img src="images/heart.png" alt="webstuffshare" /> Webstuffshare Home
		</a></li>
<li>
		<a href="http://feeds.feedburner.com/webstuffsharecom">
			<img src="images/rss.png" alt="rss" /> Subscribe RSS Feed
		</a></li>
<li>
		<a href="http://feedburner.google.com/fb/a/mailverify?uri=webstuffsharecom">
			<img src="images/email.png" alt="email" /> Subscribe Email
		</a></li>
<li>
		<a href="http://twitter.com/hdytsgt">
			<img src="images/twitter.png" alt="twitter" /> Follow Twitter
		</a></li>
</ul>

/* Sample #2 */
<ul id="fly-glow-menu">
<li>
		<a href="http://www.webstuffshare.com">
			<img src="images/heart.png" alt="webstuffshare" /> Webstuffshare Home
		</a></li>
<li>
		<a href="http://feeds.feedburner.com/webstuffsharecom">
			<img src="images/rss.png" alt="rss" /> Subscribe RSS Feed
		</a></li>
<li>
		<a href="http://feedburner.google.com/fb/a/mailverify?uri=webstuffsharecom">
			<img src="images/email.png" alt="email" /> Subscribe Email
		</a></li>
<li>
		<a href="http://twitter.com/hdytsgt">
			<img src="images/twitter.png" alt="twitter" /> Follow Twitter
		</a></li>
</ul>
</pre>
<p><br/><br />
They are arranged vertically by default, so we must arrange them horizontally using CSS property &#8216;<strong>float</strong>&#8216; with &#8216;<strong>left</strong>&#8216; value. Next, add CSS transition to make any properties change on it animated, we set the duration in <strong>0.3 seconds</strong> or <strong>300 milliseconds</strong>.</p>
<pre name="code" class="css">.cleaner {
	clear: both;
}

#fly-menu, #fly-glow-menu {
	margin: 1em auto 0 auto;
}

	#fly-menu li, #fly-glow-menu li {

		/* Basic style */
		list-style-type: none;
		margin-right: .5em;
		float: left;
		font-size: 15px;
		background: #cacaca;
		padding: 10px;
		cursor: pointer;

		/* Add shadow */
		-webkit-box-shadow: inset 0px 0px 10px rgba(0,0,0, .3);
		-moz-box-shadow: inset 0px 0px 10px rgba(0,0,0, .3);
		box-shadow: inset 0px 0px 10px rgba(0,0,0, .3);

		/*
			Add animation using transition
			-webkit : Safari &amp; Chrome.
			-moz : Firefox
			-o : Opera
		*/
		-webkit-transition: .3s ease-in-out;
  		-moz-transition: .3s ease-in-out;
  		-o-transition: .3s ease-in-out;
	}</pre>
<p><br/><br />
Since each menu is having float with left value, we need a cleaner element to make another element not floating into the menu.<br />
The last are reading hover event on each menu by adding pseudo property <strong>:hover</strong> and change the &#8216;<strong>margin-top</strong>&#8216; properties into -1em. This will make our menu fly upwards when user hovering them.</p>
<pre name="code" class="css">#fly-menu li:hover {
	margin-top: -1em;
}</pre>
<p align="center"><a href="http://webstuffshare.com/demo/CSSFlyMenu/"><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/06/Picture-22.png" alt="Picture 2" title="Picture 2" width="500" height="58" class="aligncenter size-full wp-image-2197" /></a></p>
<p><br/></p>
<p>We can also make the animation nicer by changing menu&#8217;s background color and modify its box shadow properties or anything we need.</p>
<pre name="code" class="css">#fly-glow-menu li:hover {

	margin-top: -1em;
	background: #fff;

	-webkit-box-shadow: 0px 0px 10px rgba(0,0,0, .3);
	-moz-box-shadow: 0px 0px 10px rgba(0,0,0, .3);
	box-shadow: 0px 0px 10px rgba(0,0,0, .3);
}</pre>
<p align="center"><a href="http://webstuffshare.com/demo/CSSFlyMenu/"><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/06/Picture-41.png" alt="Picture 4" title="Picture 4" width="500" height="53" class="aligncenter size-full wp-image-2196" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webstuffshare.com/2010/06/codesnippet-css3-flying-menu/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>Create Your Own Dashboard Menu</title>
		<link>http://www.webstuffshare.com/2010/06/create-your-own-dashboard-menu/</link>
		<comments>http://www.webstuffshare.com/2010/06/create-your-own-dashboard-menu/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 13:57:27 +0000</pubDate>
		<dc:creator>Hidayat Sagita</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Menu]]></category>

		<guid isPermaLink="false">http://www.webstuffshare.com/?p=2167</guid>
		<description><![CDATA[In this tutorial we are going to create our own dashboard menu as in Leopard dashboard. Dashboard menu in Leopard usually uses as a container for a tons of widgets [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.webstuffshare.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/2167.jpg&amp;w=200&amp;h=150&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p>In this tutorial we are going to create our own dashboard menu as in Leopard dashboard. Dashboard menu in Leopard usually uses as a container for a tons of widgets we have and that will be nice if we have one on our web application. First, take a look at below demo to know the result we want to build.<br />
<span id="more-2167"></span></p>
<div class="button-show-implementation"><a href="http://webstuffshare.com/demo/jQueryCSSDashboard/">Show Implementation</a></div>
<div class="button-download-source"><a href="http://www.webstuffshare.com/download/jQueryCSSDashboard.zip">Download Source</a></div>
<div class="cleaner"></div>
<p><strong>Basic Technique</strong><br />
The dashboard will be hidden out of the webpage, in this case on the bottom of the page. We can do that by setting the dahboard position into absolute, put its bottom position with minus point and set the body&#8217;s overflow properties into hidden.</p>
<p>The problem with this technique is our document content will also hidden since the body&#8217;s overflow properties was set into hidden, we can solve them by moving the dashboard into the top of the page, but in this demo we&#8217;ll continue to put them on the bottom.</p>
<p><strong>Expected Result:</strong><br/></p>
<p align="center"><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/06/Picture-5.png" alt="Picture 5" title="Picture 5" width="500" height="292" class="aligncenter size-full wp-image-2174" /></p>
<p><br/><br />
<strong>Build Dashboard</strong><br />
We&#8217;ll separate the dashboard contents into 3 parts : toggle for showing and hiding dahsboard, dashboard menu for wrapping widgets list and dot container for wrapping dashboard&#8217;s background with metallic effect. Wrap them all on one div (as a container) so we can easily move these 3 parts only by styling this div.</p>
<pre name="code" class="html">
<div id="dashboard">
	<img src="images/toggle.png" id="toggle" />
<div id="dashboard-menu">
		<!-- list of widgets -->
	</div>
<div id="dot-container">
		<!-- dots groups -->
	</div>
</div>
</pre>
<p>Now we will styling them. Set the dashboard&#8217;s width into 100%, position absolute, bottom into 0px and also add inset box shadow into them to make emboss effect. Put the toggle&#8217;s position on top of the dashboard to make it always visible even the dashboard is hidden.</p>
<pre name="code" class="css">
#dashboard {
	font-family: Arial;
	font-style: normal;
	background: #a3acb7;
	display: block;
	width: 100%;
	height: 150px;
	margin-right: auto;
	margin-left: auto;
	-webkit-box-shadow: inset 0px 0px 20px rgba(0, 0, 0, .6);
	-moz-box-shadow: inset 0px 0px 20px rgba(0, 0, 0, .6);
	box-shadow: inset 0px 0px 20px rgba(0, 0, 0, .6);
	position: absolute;
	bottom: 0px;
}

#dashboard-menu {
	position: absolute;
	display: block;
	z-index: 2;
}

#dot-container {
	display: block;
	width: 200%;
	text-align: left;
	position: absolute;
	left: 0;
	top: 0;
	z-index: 1;
}

#toggle {
	display: inline-block;
	margin-top: -3em;
	left: 0;
	position: absolute;
	cursor: pointer;
}
</pre>
<p><strong>Expected Result:</strong><br/></p>
<p align="center"><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/06/Picture-6.png" alt="Picture 6" title="Picture 6" width="500" height="291" class="aligncenter size-full wp-image-2175" /></p>
<p><br/><br />
<strong>Create Metallic Effect With CSS and jQuery</strong><br />
The most interesting technique is how to create metallic effect on dashboard&#8217;s background using only CSS and jQuery. The effect are a groups of black circle div with white shadow on it, we can repeat them horizontally until it&#8217;s equal to document width and after that repeat them vertically. Move some pixel the odd dots group&#8217;s position to make it more real.</p>
<pre name="code" class="html">
<!-- example : 1 dot -->
<div id="dot-container">
	<span class="dot">&nbsp;</span><span class="dot">&nbsp;</span><span class="dot">&nbsp;</span><span class="dot">&nbsp;</span><span class="dot">&nbsp;</span><span class="dot">&nbsp;</span>
</div>

<!-- example : dot groups -->
<div id="dot-container">
<div style="margin-left:0em; margin-bottom: -.5em">
		<span class="dot">&nbsp;</span><span class="dot">&nbsp;</span><span class="dot">&nbsp;</span><span class="dot">&nbsp;</span><span class="dot">&nbsp;</span><span class="dot">&nbsp;</span>
	</div>
<div style="margin-left:0.4em; margin-bottom: -.5em">
		<span class="dot">&nbsp;</span><span class="dot">&nbsp;</span><span class="dot">&nbsp;</span><span class="dot">&nbsp;</span>
	</div>
</div>
</pre>
<pre name="code" class="css">
.dot {
	background: #1f1f1f;
	width: 4px;
	height: 4px;
	display: inline-block;
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
	-webkit-box-shadow: 0px 1px 0px #ffffff;
	-moz-box-shadow: 0px 1px 0px #ffffff;
	box-shadow: 0px 1px 0px #ffffff;
	margin-right: .3em;
}
</pre>
<p><strong>Expected Result:</strong><br/></p>
<p align="center"><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/06/Picture.jpg" alt="Picture" title="Picture" width="294" height="311" class="aligncenter size-full wp-image-2176" /></p>
<p>We won&#8217;t create each dot by copy and paste the span since jQuery can generate and repeat them dynamically. Repeat horizontally the dots until it&#8217;s equal to document&#8217;s width and after that repeat them vertically. The last thing to do is insert them into dot container div.</p>
<pre name="code" class="javascript">
//Create base variable, check document width and count how much dot per line.
var a, b, element = '';
documentWidth		= $(window).width();
dotLength			= parseInt(documentWidth/10);

//Loop dot per line
for(a=0; a<= 11; a++) {

	//Check is even or odd to add some pixel to the margin left
	className= ((a%2) == 0) ? '0' : '0.4em';
	element 	= element + '
<div style="margin-left:'+className+'; margin-bottom: -.5em">\n';

		//Loop to create the dot
		for(b=0; b<=dotLength; b++) {
			element = element + '\t<span class="dot">&nbsp;</span>';
		}

	element = element + '</div>

';
}

//Insert dots on #dot-container
$('#dot-container').html(element);
</pre>
<p><br/><br />
<strong>Put The Widgets</strong><br />
The dashboard was setted perfectly, now we&#8217;ll put the widgets list. Put each widgets on unordered list and add its widget name below the widget.</p>
<pre name="code" class="html">
<div id="dashboard-menu">
<ul>
<li>
		<img src="images/gauge.png" /> <br/> Dashboard
		</li>
<li>
		<img src="images/mail.png" /> <br/> E-Mail Client
		</li>
<li>
		<img src="images/calendar.png" /> <br/> Calendar
		</li>
<li>
		<img src="images/map.png" /> <br/> Geolocation
		</li>
<li>
		<img src="images/note.png" /> <br/> Sticky Note
		</li>
<li>
		<img src="images/wireless.png" /> <br/> AirPort
		</li>
<li>
		<img src="images/calculator.png" /> <br/> Calculator
		</li>
</ul>
</div>
</pre>
<p><strong>Expected Result:</strong><br/></p>
<p align="center"><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/06/Picture-12.png" alt="Picture 12" title="Picture 12" width="456" height="213" class="aligncenter size-full wp-image-2177" /></p>
<p><br/><br />
The list still appear vertical, now we must set them into horizontal orientation by set its display properties into inline-block. Add the distance on each widget and set its margin properly.</p>
<pre name="code" class="css">
#dashboard-menu {
	position: absolute;
	display: block;
	left: -65em;
	z-index: 2;
}

	#dashboard-menu ul li {
		display: inline-block;
		text-align: center;
		margin-right: 2em;
		margin-top: 1em;
		color: #313235;
		text-shadow: 0px 1px 0px #fff;
		font-weight: bold;
	}

	li img {
		margin-bottom: .7em;
		border: 0;
		cursor: pointer;
	}
</pre>
<p><strong>Expected Result:</strong><br/></p>
<p align="center"><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/06/Picture-13.png" alt="Picture 13" title="Picture 13" width="500" height="98" class="aligncenter size-full wp-image-2178" /></p>
<p><br/><br />
We want the widgets is moving from left to right when the dashboard is show up, so we need to set its left property into -65em.</p>
<p><br/><br />
<strong>Hide and Seek</strong><br />
Now we&#8217;ll add some jQuery code to the dashboard to make it able showing and hiding. Firstly we must hide the dashboard position by setting its position with some minus pixels, so it will be hidden.</p>
<pre name="code" class="css">
#dashboard {
	font-family: Arial;
	font-style: normal;
	background: #a3acb7;
	display: block;
	width: 100%;
	height: 150px;
	margin-right: auto;
	margin-left: auto;
	-webkit-box-shadow: inset 0px 0px 20px rgba(0, 0, 0, .6);
	-moz-box-shadow: inset 0px 0px 20px rgba(0, 0, 0, .6);
	box-shadow: inset 0px 0px 20px rgba(0, 0, 0, .6);
	position: absolute;
	bottom: -150px;
}
</pre>
<p>Add toggle function to the image toggle, the first function will rotate the image toggle by set its rotate property into 45 degree (we need zachstronaut&#8217;s plugin for doing this), show the dashboard by set its bottom property value into 0px and show the menu by set its left into 3em. These action is in animate function so any change will have animation. For the second function we just need to revert these value.</p>
<pre name="code" class="javascript">
//Add event toggle on #toggle
$('#toggle').toggle(

	function() {

		//Rotate toggle
		$(this).stop().animate({rotate : '-=45deg'});
		$('#dashboard').stop().animate({bottom : '0px'});
		$('#dashboard-menu').stop().animate({left : '3em'});
	},

	function() {

		//Revert rotate toggle
		$(this).stop().animate({rotate : '0deg'});
		$('#dashboard').stop().animate({bottom : '-150px'}, 700);
		$('#dashboard-menu').stop().animate({left : '-65em'});
	}
);
</pre>
<p>That&#8217;s it we just made our simple dashboard menu, hope you enjoy my post and thank your for reading! <img src='http://www.webstuffshare.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webstuffshare.com/2010/06/create-your-own-dashboard-menu/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Simple CSS3 Dropdown Menu</title>
		<link>http://www.webstuffshare.com/2010/06/simple-css3-dropdown-menu/</link>
		<comments>http://www.webstuffshare.com/2010/06/simple-css3-dropdown-menu/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 16:30:46 +0000</pubDate>
		<dc:creator>Hidayat Sagita</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Menu]]></category>

		<guid isPermaLink="false">http://www.webstuffshare.com/?p=2129</guid>
		<description><![CDATA[As we know, CSS3 has many good features for help us creating more sweet User Interface. One of them is box shadow, it helps us adding shadow effect on each [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.webstuffshare.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/2129.jpg&amp;w=200&amp;h=150&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p>As we know, CSS3 has many good features for help us creating more sweet User Interface. One of them is box shadow, it helps us adding shadow effect on each styled element. You must be familiar with drop down menu with shadow effect on it, I usually add the effect using some images but now we&#8217;ll create that one using pure CSS.<br />
<span id="more-2129"></span></p>
<div class="button-show-implementation"><a href="http://webstuffshare.com/demo/CSSDropmenu/">Show Implementation</a></div>
<div class="button-download-source"><a href="http://www.webstuffshare.com/download/CSSDropmenu.zip">Download Source</a></div>
<div class="cleaner"></div>
<p><strong>Drop Down Technique</strong><br />
To create drop down menu like the demo we can use a div for the menu container and an unordered list for the menu. Wrap the unordered list on the div and hide them, we&#8217;ll only show the menu when user hovering the div. Take a look at following image :</p>
<p align="center"><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/06/Picture-1.jpg" alt="Picture 1" title="Picture 1" width="500" height="501" class="aligncenter size-full wp-image-2136" /></p>
<p>As you mention above, the unordered list (the menu) is hidden, positioned inside the div and under the text &#8220;Please choose following menu&#8221;. So when the user hover the menu container the menu will have sub menu below it.<br/><br/></p>
<p><strong>The Object and Its Style</strong><br />
As I said above the menu container will contains unordered list as the menu, so we will wrap the unordered list with the div :</p>
<pre name="code" class="html">
<div class="drop-menu">
	<span class="plus">+</span> &nbsp; Please choose following menu
<ul class="sub-menu">
<li>
			<a href="http://feeds.feedburner.com/webstuffsharecom">
				<img src="images/rss.png" border="0" alt="rss" /> Subscribe RSS Feed
			</a>
		</li>
<li>
			<a href="http://feedburner.google.com/fb/a/mailverify?uri=webstuffsharecom">
				<img src="images/email.png" border="0" alt="email" /> Subscribe Email Subscription
			</a>
		</li>
<li>
			<a href="http://twitter.com/hdytsgt">
				<img src="images/twitter.png" border="0" alt="twitter"/> Follow My Twitter
			</a>
		</li>
</ul>
</div>
</pre>
<p align="center"><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/06/Picture-6.jpg" alt="Picture 6" title="Picture 6" width="303" height="181" class="aligncenter size-full wp-image-2137" /></p>
<p><br/><br />
The important thing is we must fixed the menu container&#8217;s height (class name : <strong>drop-menu</strong>) so no matter how much list (class name : <strong>sub-menu</strong>) element inside, its height will not change. We can also make it more cute by set up its padding, font size, border and also the cursor property.</p>
<pre name="code" class="css">
.drop-menu {
	display: block;
	margin-right: auto;
	margin-left: auto;
	text-align: left;
	padding: 10px 10px;
	font-size: 22px;
	height: 25px;
	max-height: 25px;
	width: 400px;
	background: #fff;
	cursor: pointer;
	border: 1px solid #f6f0e4;
}
</pre>
<p><strong>Expected Result:</strong><br/></p>
<p align="center"><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/06/Picture-7.png" alt="Picture 7" title="Picture 7" width="451" height="72" class="aligncenter size-full wp-image-2138" /></p>
<p><br/><br />
We need an hover event in the menu container for showing up the menu, we can use CSS pseudo-class <strong>:hover</strong>. Since we want to show the menu by menu container hover event we can use CSS nesting :</p>
<pre name="code" class="css">
.drop-menu:hover .sub-menu {
	display: inline-block;
}
</pre>
<p>Next is styling the menu, set its width, background and padding equal to its parent. Add a shadow effect by setting its <strong>box-shadow</strong> property, set <strong>x-axis</strong> to <strong>0px</strong>, <strong>y-axis</strong> to <strong>13px</strong>, <strong>blur</strong> to <strong>25px</strong> and <strong>shadow color</strong> to <strong>black</strong> with <strong>20% alpha</strong>. This will make the shadow has a gradient effect.</p>
<pre name="code" class="css">
.sub-menu {
	display: none;
	width: 400px;
	background: #fff;
	padding: 10px 10px;
	margin-left: -11px;
	margin-top: 10px;
	border: 1px solid #fff;
	-webkit-box-shadow: 0px 13px 25px rgba(0,0,0, 0.2);
	-moz-box-shadow: 0px 13px 25px rgba(0,0,0, 0.2);
	box-shadow: 0px 13px 25px rgba(0,0,0, 0.2);
}

	.sub-menu li {
		list-style-type: none;
		display: block;
		border-bottom: 1px dotted #eaeaea;
		font-size: 19px;
		height: 22px;
		padding: 8px 0;
	}

		.sub-menu li img {
			margin-right: .5em;
		}

	.sub-menu li:hover {
		border-bottom: 1px dotted #bababa;
	}
</pre>
<p><strong>Expected Result:</strong><br/></p>
<p align="center"><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/06/Picture-8.png" alt="Picture 8" title="Picture 8" width="467" height="187" class="aligncenter size-full wp-image-2139" /></p>
<p><br/><br />
We also will add a little animation to the plus symbol, if the user hovering menu container we will rotate the plus symbol into 45 degree so it will transform into crosswise.</p>
<pre name="code" class="css">
.plus {
	display: inline-block;
	-webkit-transition: .3s ease-in-out;
  	-moz-transition: .3s ease-in-out;
  	-o-transition: .3s ease-in-out;
}

.drop-menu:hover .plus {
	-webkit-transform: rotate(45deg);
	-moz-transform: rotate(45deg);
	-o-transform: rotate(45deg);
}
</pre>
<p align="center"><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/06/Picture-2.jpg" alt="Picture 2" title="Picture 2" width="228" height="61" class="aligncenter size-full wp-image-2140" /></p>
<p><br/><br />
Wrap them up :</p>
<pre name="code" class="css">
* {
	margin:0; padding:0;
}

body {
	font-family: Georgia;
	background: #fff9ec;
	text-align: center;
	color: #464530;
	text-shadow: 0px 1px 0px #fff;
	font-size: 30px;
	font-weight: bold;
	letter-spacing: -1px;
	margin-top: 3%;
}

a, a:visited {
	color: #464530;
	text-decoration: none;
}

label {
	font-size: 20px;
}

#content {
	display: block;
	width: 800px;
	margin-right: auto;
	margin-left: auto;
	text-align: center;
}

.drop-menu {
	display: block;
	margin-right: auto;
	margin-left: auto;
	text-align: left;
	padding: 10px 10px;
	font-size: 22px;
	height: 25px;
	max-height: 25px;
	width: 400px;
	background: #fff;
	cursor: pointer;
	border: 1px solid #f6f0e4;
}

	.plus {
		display: inline-block;
		-webkit-transition: .3s ease-in-out;
  		-moz-transition: .3s ease-in-out;
  		-o-transition: .3s ease-in-out;
	}

	.drop-menu:hover {
		border: 1px solid #fff;
	}

	.drop-menu:hover .sub-menu {
		display: inline-block;
	}

	.drop-menu:hover .plus {
		-webkit-transform: rotate(45deg);
		-moz-transform: rotate(45deg);
		-o-transform: rotate(45deg);
	}

	.sub-menu {
		display: none;
		width: 400px;
		background: #fff;
		padding: 10px 10px;
		margin-left: -11px;
		margin-top: 10px;
		border: 1px solid #fff;
		-webkit-box-shadow: 0px 13px 25px rgba(0,0,0, 0.2);
		-moz-box-shadow: 0px 13px 25px rgba(0,0,0, 0.2);
		box-shadow: 0px 13px 25px rgba(0,0,0, 0.2);
	}

	.sub-menu li {
		list-style-type: none;
		display: block;
		border-bottom: 1px dotted #eaeaea;
		font-size: 19px;
		height: 22px;
		padding: 8px 0;
	}

		.sub-menu li img {
			margin-right: .5em;
		}

	.sub-menu li:hover {
		border-bottom: 1px dotted #bababa;
	}
</pre>
<p><strong>Conclusion</strong><br />
That&#8217;s it, we have made simple drop down menu using pure CSS. By using CSS3 properties we can tune our element into another level and also we can minimize the use of images. Thanks for reading! <img src='http://www.webstuffshare.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webstuffshare.com/2010/06/simple-css3-dropdown-menu/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>Filter Image View Using jQuery</title>
		<link>http://www.webstuffshare.com/2010/05/filter-image-view-using-jquery/</link>
		<comments>http://www.webstuffshare.com/2010/05/filter-image-view-using-jquery/#comments</comments>
		<pubDate>Wed, 12 May 2010 17:25:22 +0000</pubDate>
		<dc:creator>Hidayat Sagita</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Menu]]></category>

		<guid isPermaLink="false">http://www.webstuffshare.com/?p=2068</guid>
		<description><![CDATA[Tobias Ahlin is a great designer from Sweden, I admire his work and his way showcasing his portfolio. It comes up with the list of all his works and the [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.webstuffshare.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/2068.jpg&amp;w=200&amp;h=150&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p><a href="http://tobiasahlin.com/" target="_blank">Tobias Ahlin</a> is a great designer from Sweden, I admire his work and his way showcasing his portfolio. It comes up with the list of all his works and the anchor for filtering work type above them, we can choose one of the filter and it&#8217;s automatically hiding and showing portfolio item using horizontal slide effect. Now, <strong>in my view</strong>, I am going to explain how they beautifully works.<span id="more-2068"></span></p>
<div class="button-show-implementation"><a href="http://webstuffshare.com/demo/FilterImages/">Show Implementation</a></div>
<div class="button-download-source"><a href="http://www.webstuffshare.com/download/FilterImages.zip">Download Source</a></div>
<div class="cleaner"></div>
<div style="display:block; background:#fffbcc;border: 1px solid #e6db55; margin .5em;text-align:center;">
I’ve put together the request from webstuffshare visitor, the updates are Paging, Lightbox integration, Text explanation under the gallery. You can download the update in here <a href="http://www.webstuffshare.com/download/FilterImages2.zip">http://www.webstuffshare.com/download/FilterImages2.zip</a>
</div>
<p><br/><br />
<strong>The Technique</strong><br />
As you can see on the demo page, the image items are showing and hiding with horizontal slide effect based on user choice. Horizontal slide effect produced by manipulating item&#8217;s width, when hiding the item we will change the item width into 0 pixel, and when showing the item we will return its default width.</p>
<p>To make the item&#8217;s width transformation smooth we will also change its opacity, for hiding the item set the opacity from 100% to 0% and vice versa for showing them. We can show and hide the item but we won&#8217;t see the slide effect transition, so we must use built-in jQuery function, <strong>animate()</strong>.<br/><br/></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-2075" title="first" src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/05/first2.png" alt="first" width="500" height="242" /></p>
<p><br/><br/></p>
<p><strong>Setup The Item&#8217;s View</strong><br />
We&#8217;ll create two separated section, first the navigation and the last is the items list. The navigation will contains anchor links which will navigate the items visibility, while items list will contains image item which will be show and hide.</p>
<p>Now, create navigation and items list like following script :</p>
<pre name="code" class="html">
<ul class="menu">
<li class="selected"><a rel="all" href="#">All Tutorial</a></li>
<li><a rel="jquery" href="#">jQuery Tutorial</a></li>
<li><a rel="css" href="#">CSS Tutorial</a></li>
<li><a rel="psd" href="#">Free PSD</a></li>
</ul>
<ul class="item">
<li><img src="images/button.jpg" alt="" /></li>
<li><img src="images/codesnippet.jpg" alt="" /></li>
<li><img src="images/css.jpg" alt="" /></li>
<li><img src="images/css2.jpg" alt="" /></li>
<li><img src="images/psd.jpg" alt="" /></li>
<li><img src="images/groovershark.png" alt="" /></li>
<li><img src="images/stylize.jpg" alt="" /></li>
<li><img src="images/psd2.jpg" alt="" /></li>
</ul>
</pre>
<p>As you mention above, each navigation and item has <strong>rel</strong> attribute that represent each category. The purpose is when user choosing one of the navigation, the items that will be displayed only an item which has same <strong>rel</strong> attribute with the navigation, the others will be hidden.</p>
<p>We will styling the navigation first, set the list display with inline-block so the unordered list will be displayed horizontally. If the user select one of the navigation, we will add <strong>&#8220;selected&#8221;</strong> class name to them. &#8220;selected&#8221; style are having green background with box-shadow and border radisu, so the selected navigation will have different style with the siblings.</p>
<pre name="code" class="css">ul.menu {
	margin-left: .5em;
	margin-bottom: 1em;
}

ul.menu li {
	list-style-type: none;
	display: inline-block;
	font-weight: bold;
	text-shadow: 1px 1px 0px #f3f5da;
	padding: 2px 15px;
}

	.selected {
		-webkit-border-radius: 15px;
		-moz-border-radius: 5px;
		border-radius: 5px;
		background: #acac75;
		-webkit-box-shadow: 1px 1px 0px #8c8c5d;
	}

	.selected a, .selected a:visited {
		text-shadow: 1px 1px 0px #8c8c60;
		color: #fff;
	}</pre>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-2072" title="one" src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/05/one.png" alt="one" width="491" height="313" /></p>
<p>Now styling the image items, set each item display with block, list style type with none, float with left and margin with 0.5 em. Each image inside the list will have 5pixels white border thickness, border radius 5 pixels and also box shadow.</p>
<pre name="code" class="css">ul.item li {
	list-style-type: none;
	display: block;
	float: left;
	margin: .5em;
}

	ul.item li img {
		border: 5px solid #fff;
		-webkit-border-radius: 5px;
		-moz-border-radius: 5px;
		border-radius: 5px;
		-webkit-box-shadow: 0px 0px 5px #ac987e;
		-moz-box-shadow: 0px 0px 5px #ac987e;
		box-shadow: 0px 0px 5px #ac987e;
	}</pre>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-2073" title="two" src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/05/two.png" alt="two" width="470" height="346" /></p>
<p><strong>Slide Effect With animate()</strong><br />
The slide effect will fire up when user click the navigation, so we will add click event to them. After that, remove &#8220;selected&#8221; class name from all navigation and add it to selected navigation. This will make selected navigation will have different style with its siblings.</p>
<pre name="code" class="javascript">$('.menu li a').click(function() {
	$('.menu li').removeClass('selected');
	$(this).parent('li').addClass('selected');</pre>
<p>Next, get its <strong>rel</strong> attribute value and check it. If the value is &#8220;all&#8221; (which mean showing all image item) we will display all image item and if the value is other we will search any image item that has same <strong>rel<strong> attribute value and display it then hide the others.</strong></strong></p>
<p><strong><strong> </strong></strong></p>
<pre name="code" class="javascript">thisItem 	= $(this).attr('rel');

if(thisItem != "all") {

	$('.item li[rel='+thisItem+']').stop()
	.animate({'width' : '110px',
				 'opacity' : 1,
				 'marginRight' : '.5em',
				 'marginLeft' : '.5em'
				});

	$('.item li[rel!='+thisItem+']').stop()
	.animate({'width' : 0,
				 'opacity' : 0,
				 'marginRight' : 0,
				 'marginLeft' : 0
				});
} else {

	$('.item li').stop()
	.animate({'opacity' : 1,
			 'width' : '110px',
			 'marginRight' : '.5em',
			 'marginLeft' : '.5em'
			});
}
})</pre>
<p>As you can see above, for displaying the item we search all item which having same <strong>rel</strong> attribute value with the selected navigation. Then we start the animation which will animate the item width to the image&#8217;s width, set its opacity to 100% and set each margin left and right to 0.5em. To prevent animation queue, we use <strong>stop()</strong> function before <strong>animate()</strong> function.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-2074" title="three" src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/05/three.jpg" alt="three" width="375" height="206" /></p>
<p>For hiding the sibling we use the same technique as above except the animation properties&#8217;s value, set each animation properties&#8217;s value to 0.</p>
<p>At this point our item will be show and hide using slide effect, triggered by the navigation. The last thing we will do is to make the image items smoother by adjusting its opacity. Set each image opacity to 50% using animation and hover toggle event, if the user hovering it, animate its opacity to 100% and revert it value to 50% when user hovering out.</p>
<pre name="code" class="javascript">$('.item li img').animate({'opacity' : 0.5}).hover(function() {
	$(this).animate({'opacity' : 1});
}, function() {
	$(this).animate({'opacity' : 0.5});
});</pre>
<p>Ok, that&#8217;s it. Thanks for reading and hope this post useful <img src='http://www.webstuffshare.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webstuffshare.com/2010/05/filter-image-view-using-jquery/feed/</wfw:commentRss>
		<slash:comments>91</slash:comments>
		</item>
		<item>
		<title>Photoshop Effect vs CSS3 Properties</title>
		<link>http://www.webstuffshare.com/2010/04/photoshop-effect-vs-css3-properties/</link>
		<comments>http://www.webstuffshare.com/2010/04/photoshop-effect-vs-css3-properties/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 09:17:05 +0000</pubDate>
		<dc:creator>Hidayat Sagita</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[Menu]]></category>

		<guid isPermaLink="false">http://www.webstuffshare.com/?p=1925</guid>
		<description><![CDATA[In previous tutorial I was explained how to stylize input element with photoshop effect (color gradient, smooth border, box shadow, drop shadow) using CSS3 only. In this post We will [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.webstuffshare.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/1925.jpg&amp;w=200&amp;h=150&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p>In <a href="http://www.webstuffshare.com/2010/04/stylize-input-element-using-css3/">previous tutorial</a> I was explained how to stylize input element with photoshop effect (color gradient, smooth border, box shadow, drop shadow) using CSS3 only. In this post We will play in depth with them, since they have advantages on their own field I&#8217;m not going to compare both of them nevertheless.<span id="more-1925"></span></p>
<div class="button-show-implementation"><a href="http://webstuffshare.com/demo/PhotoshopCSS3/">Show Implementation</a></div>
<div class="button-download-source"><a href="http://www.webstuffshare.com/download/PhotoshopCSS3.zip">Download Source</a></div>
<div class="cleaner"></div>
<p><strong>Common Photoshop Techniques</strong><br />
When I need a shiny buttons with color gradient inside them, smooth bevel like Mac-style, I usually create them in Photoshop, but recently I realized that CSS3 properties can do some of Photoshop&#8217;s task like Color Gradient, Stroke, Drop Shadow, Smooth Bevel and even Layer Masking. Take a look at following images : <br/><br/></p>
<p align="center"><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/04/button.png" alt="button" title="button" width="474" height="191" class="aligncenter size-full wp-image-1933" /></p>
<p><br/></p>
<p>What I have done are adding color gradient inside the buttons, masking half of buttons with white layer in 50% opacity, smooth bevel, smooth drop shadow and white shadow on each text inside the buttons. I guarantee CSS3 can do exactly the same techniques as I did before with Photoshop.<br/><br/></p>
<p><strong>CSS3 Techniques</strong><br />
This will be refresh your memory about replacing Photoshop techniques using only CSS3 properties. Some techniques we&#8217;ve discussed in previous post, the other techniques are smooth bevel and layer masking :</p>
<ul style="margin: .5em 0 1em 3em">
<li style="padding: .5em"><strong>Color Gradient</strong> using <strong>-webkit-gradient</strong> or <strong>-moz-linear-gradient</strong> property.</li>
<li style="padding: .5em"><strong>Stroke</strong> using <strong>border</strong> property.</li>
<li style="padding: .5em"><strong>Drop Shadow</strong> using <strong>-webkit-box-shadow</strong>, <strong>-moz-box-shadow</strong> or <strong>box-shadow</strong> property.</li>
<li style="padding: .5em"><strong>Rounded Corner</strong> using <strong>-webkit-boder-radius</strong>, <strong>-moz-border-radius</strong> or <strong>boder-radius property</strong>.</li>
<li style="padding: .5em"><strong>Smooth Bevel</strong> using <strong>border</strong> property on one side or more with 1pixel thickness, white color.</li>
<li style="padding: .5em"><strong>Layer Masking</strong> using stacked layer where the top layer&#8217;s height is an half of bottom layer&#8217;s, fill with any matched color and of course set its opacity.</li>
</ul>
<p> <br/></p>
<p align="center"><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/04/buttoncss.png" alt="buttoncss" title="buttoncss" width="474" height="191" class="aligncenter size-full wp-image-1934" /></p>
<p><br/></p>
<p><strong>Test Case #1 : Buttons</strong><br />
Now we will create buttons with Photoshop effect using CSS3 properties above. First we create the HTML element :</p>
<pre name="code" class="html">
<a class="button-red" href="#">
	<span class="button-red-inner">
		Preview
	</span>
</a>
</pre>
<p>The anchor element will be a whole button&#8217;s body, while span element will be a smooth bevel placeholder. Now fill the anchor with color gradient, set span&#8217;s top border with 1pixel thickness, fill with white and set opacity into 60%.</p>
<pre name="code" class="css">
.button-red {
	font-family: Arial, Helvetica;
	display: inline-block;
	width: 200px;
	height: 50px;
	background : -webkit-gradient(linear, left top, left bottom, color-stop(0.25, rgb(255,71,71)), color-stop(1, rgb(200,17,17)));
	background : -moz-linear-gradient(center top, rgb(255,71,71) 25%, rgb(200,17,17) 100%);
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;
	padding: 1px;
	cursor: pointer;
	text-align: center;
}
</pre>
<p>If the user is hovering the buttons we set the lighter color for the buttons and revert it when it&#8217;s active.</p>
<pre name="code" class="css">
.button-red:hover {
	background : -webkit-gradient(linear, left top, left bottom, color-stop(0.25, rgb(255,105,105)), color-stop(1, rgb(213,13,13)));
	background : -moz-linear-gradient(center top, rgb(255,105,105) 25%, rgb(213,13,13) 100%);
}

.button-red:active {
	background : -webkit-gradient(linear, left top, left bottom, color-stop(0.25, rgb(255,71,71)), color-stop(1, rgb(200,17,17)));
	background : -moz-linear-gradient(center top, rgb(255,71,71) 25%, rgb(200,17,17) 100%);
}
</pre>
<p><strong>Expected Result :</strong></p>
<p align="center"><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/04/Picture-31.png" alt="Picture 3" title="Picture 3" width="218" height="73" class="aligncenter size-full wp-image-1943" /></p>
<p>And that&#8217;s it we&#8217;ve created a smooth and shiny buttons with only CSS3.<br />
<br/><br />
<strong>Test Case #2 : Squares</strong><br />
Another techniques we&#8217;ll use to create a button are drop shadow and layer masking. Create the HTML element :</p>
<pre name="code" class="html">
<a class="square-blue" href="#">
	<span class="square-shade"></span>
	<span class="square-inner">
		OK
	</span>
</a>
</pre>
<p>There are no different with previous test case except the span with class name &#8220;square-shade&#8221;, the &#8220;square-shade&#8221; will be a layer masking. Fill the anchor with color gradient, set span&#8217;s top and bottom border with 1pixel thickness, fill with white and set opacity into 70% for the top border and 30% for the bottom border. Don&#8217;t forget to set box shadow property with black and its opacity into 50%.</p>
<pre name="code" class="css">
.square-blue {
	font-family: Arial, Helvetica;
	display: inline-block;
	width: 60px;
	height: 60px;
	background : -webkit-gradient(linear, left top, left bottom, color-stop(0.25, rgb(71, 181, 255)), color-stop(1, rgb(0,133,222)));
	background : -moz-linear-gradient(center top, rgb(71, 181, 255) 25%, rgb(0,133,222) 100%);
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;
	padding: 1px;
	cursor: pointer;
	position: relative;
	text-align: center;
	-webkit-box-shadow: 0px 1px 2px rgba(0,0,0, 0.5);
	-moz-box-shadow: 0px 1px 2px rgba(0,0,0, 0.5);
	box-shadow:  0px 1px 2px rgba(0,0,0, 0.5);
}

	.square-blue:hover {
		background : -webkit-gradient(linear, left top, left bottom, color-stop(0.25, rgb(108, 196, 255)), color-stop(1, rgb(0,133,222)));
		background : -moz-linear-gradient(center top, rgb(108, 196, 255) 25%, rgb(0,133,222) 100%);
	}

	.square-blue:active {
		background : -webkit-gradient(linear, left top, left bottom, color-stop(0.25, rgb(71, 181, 255)), color-stop(1, rgb(0,133,222)));
		background : -moz-linear-gradient(center top, rgb(71, 181, 255) 25%, rgb(0,133,222) 100%);
	}
</pre>
<p>Set the &#8220;square-shade&#8221; position into absolute so it will be pile up with the &#8220;square-inner&#8221;, set its width as anchor&#8217;s width and set its height into an half from anchor&#8217;s height. Set its top border radius into 5 pixels and botton border radius into 0 pixel. Fill with white color and set its opacity into 20%.</p>
<pre name="code" class="css">
.square-shade {
	display: inline-block;
	position: absolute;
	width: 60px;
	height: 30px;
	margin-top: 2px;
	background: rgba(255, 255,255, .2);
	-webkit-border-radius: 5px;
	-webkit-border-bottom-right-radius: 0px;
	-webkit-border-bottom-left-radius: 0px;
	-moz-border-radius: 5px;
	-moz-border-radius-bottomright: 0px;
	-moz-border-radius-bottomleft: 0px;
	border-radius: 5px;
	border-bottom-right-radius: 0px;
	border-bottom-left-radius: 0px;
}
</pre>
<p><strong>Expected Result :</strong></p>
<p align="center"><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/04/Picture-41.png" alt="Picture 4" title="Picture 4" width="141" height="86" class="aligncenter size-full wp-image-1942" /></p>
<p>Sweet isn&#8217;t it? Now we&#8217;ll create a badges. Badges usually used for displaying small information from a product or anything important. Take a look at following case :<br />
<br/><br />
<strong>Test Case #3 : Badges</strong><br />
The technique for creating badges is very simple, we just need a rectangular element, fill it with color gradient and text as we did on test case #1 and #2 then rotate them into 40 degree.</p>
<p>Wrap them together in the Div which contains an image and set its overflow property into hidden, this will make the badges looks like shielding the Div. The last step is adding drop shadow into the badges to make it looks more real.</p>
<p>Prepare an images which we will put badges, set the HTML element into following code :</p>
<pre name="code" class="html">
<div class="badges-webstuffshare">
<div class="badges-inner-left">
<div class="badges-text">New!</div>
</div>
</div>
</pre>
<p>The &#8220;badges-webstuffshare&#8221; div will be a div wrapper that contains an image, &#8220;badges-inner-left&#8221; will become the badges and badges-text will contains any text we will show. Set &#8220;badges-banner&#8221; background with your prepared image, set its width and height based on image&#8217;s width and height. Set its position into relative and overflow into hidden.</p>
<pre name="code" class="css">
.badges-webstuffshare {
	font-family: Arial, Helvetica;
	display: inline-block;
	width: 365px;
	height: 214px;
	background: url('images/webstuffshare.png');
	position: relative;
	overflow: hidden;
	text-align: center;
}
</pre>
<p>Set &#8220;badges-inner-left&#8221; position into absolute, fill with color gradient, rotate into 40 degree and add box shadow.</p>
<pre name="code" class="css">
.badges-inner-left {
	position: absolute;
	left: -3.7em;
	background : -webkit-gradient(linear, left top, left bottom, color-stop(0.25, rgb(255,71,71)), color-stop(1, rgb(200,17,17)));
	background : -moz-linear-gradient(center top, rgb(255,71,71) 25%, rgb(200,17,17) 100%);
	padding-top: 1px;
	height: 40px;
	width: 200px;
	font-size: 20px;
	color: #fff;
	text-shadow: 0px 1px 0px #6c0909;
	-webkit-transform: rotate(-40deg);
	-moz-transform: rotate(-40deg);
	-webkit-box-shadow: 0px 1px 2px rgba(0,0,0, 0.5);
	-moz-box-shadow: 0px 1px 2px rgba(0,0,0, 0.5);
	box-shadow:  0px 1px 2px rgba(0,0,0, 0.5);
	}

.badges-text {
	border-top: 1px solid rgba(255, 255, 255, 0.7);
	padding-top: 9px;
}
</pre>
<p><strong>Expected Result :</strong></p>
<p align="center"><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/04/Picture-51.png" alt="Picture 5" title="Picture 5" width="379" height="237" class="aligncenter size-full wp-image-1941" /></p>
<p>If you want to modify badges position you can set &#8220;badges-inner-left&#8221; top and left property based on your need. Try increasing its height to get bigger badges.</p>
<p><strong>Expected Result :</strong></p>
<p align="center"><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/04/Picture-7.png" alt="Picture 7" title="Picture 7" width="373" height="240" class="aligncenter size-full wp-image-1940" /></p>
<p><br/><br />
<strong>Next Post : Test Case #4 &#8211; CSS Music Player</strong><br />
For next post tutorial, I will continue explaining CSS3 test case, I choosed Music Player using only CSS3 like following image, so stay tune <img src='http://www.webstuffshare.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p align="center"><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/04/Picture-62.png" alt="Picture 6" title="Picture 6" width="500" height="96" class="aligncenter size-full wp-image-1947" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webstuffshare.com/2010/04/photoshop-effect-vs-css3-properties/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>Nice Menu : CSS Animation &amp; jQuery Animate</title>
		<link>http://www.webstuffshare.com/2010/04/nice-menu-css-animation-jquery-animate/</link>
		<comments>http://www.webstuffshare.com/2010/04/nice-menu-css-animation-jquery-animate/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 12:23:37 +0000</pubDate>
		<dc:creator>Hidayat Sagita</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Menu]]></category>

		<guid isPermaLink="false">http://www.webstuffshare.com/?p=1836</guid>
		<description><![CDATA[Expressjs has a nice button menu. Yes it absolutely nice since it has opacity and box shadow on each button, automatically widen when mouseover and again opacity to transparent when [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.webstuffshare.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/1836.jpg&amp;w=200&amp;h=150&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p><a href="http://expressjs.com/index.html" target="_blank">Expressjs</a> has a nice button menu. Yes it absolutely nice since it has opacity and box shadow on each button, automatically widen when mouseover and again opacity to transparent when mousedown. I&#8217;d like to explain how they works with pure CSS version and jQuery version.<span id="more-1836"></span></p>
<div class="button-show-implementation"><a href="http://webstuffshare.com/demo/CSSNiceMenu/">Show Implementation</a></div>
<div class="button-download-source"><a href="http://www.webstuffshare.com/download/CSSNiceMenu.zip">Download Source</a></div>
<div class="cleaner"></div>
<p><strong>The Technique</strong><br />
There are two techniques we want to do, opacity and widen the button. Opacity is an effortless technique since it was supported by CSS while widening the button is only CSS technique by increasing the button&#8217;s current padding with some pixels number. So, when the user mouseover the button we will add its padding to make it wide and decrease the button&#8217;s opacity when user click it.<br />
<br/><br/></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-1842" title="menu" src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/04/menu.jpg" alt="menu" width="418" height="84" /></p>
<p><br/><br/></p>
<p><strong>Pure CSS</strong><br />
Now based on the technique above we&#8217;ll create these button using pure CSS. First we create the button list using unordered list and then we set its style. Set the list&#8217;s display with inline, fill its background color with black and <strong>opacity</strong> with 20% (CSS value : 0.2), add <strong>box-shadow</strong> and set its <strong>border-radius</strong> into 15px to make it rounded. For opacity on background color we will use <strong>rgba()</strong>.<br/><br/></p>
<pre name="code" class="html">
<ul id="menu-css">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Portfolio</a></li>
<li><a href="#">Contact</a></li>
</ul>
</pre>
<p><br/><br/></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-1843" title="menu-list" src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/04/menu-list.jpg" alt="menu-list" width="163" height="105" /></p>
<p><br/><br/></p>
<pre name="code" class="css">#menu-css li {
	display: inline;
	list-style: none;
}

#menu-css li a {

	/* Border Radius */
	-webkit-border-radius: 15px;
	-moz-border-radius: 15px;
	border-radius: 15px;

	/* Border Shadow */
	-webkit-box-shadow: 1px 2px 2px rgba(0,0,0,0.6);
	-moz-box-shadow: 1px 2px 2px rgba(0,0,0,0.6);
	box-shadow: 1px 2px 2px rgba(0,0,0,0.6);

	color: #ffffff;
	background: rgba(0,0,0,0.2);
	display: inline-block;
	padding: 5px 15px;
	outline: none;
	text-decoration: none;
}</pre>
<p><br/><br/></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-1844" title="menu-css" src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/04/menu-css.jpg" alt="menu-css" width="356" height="74" /></p>
<p><br/><br/></p>
<p>When user mouseover the button we&#8217;ll adding its padding and increase its opacity into 50% (CSS value : 0.5) and when user click it we decrease its opacity into 10% (CSS value : 0.1).</p>
<pre name="code" class="css">#menu-css li a:hover {
	background: rgba(0,0,0,0.5);
	padding: 5px 25px;
}

#menu-css li a:active {
	background: rgba(0,0,0,0.1);
	-webkit-box-shadow: 1px 1px 1px rgba(0,0,0,0.4);
	-moz-box-shadow: 1px 1px 1px rgba(0,0,0,0.4);
	box-shadow: 1px 1px 1px rgba(0,0,0,0.4);
}</pre>
<p><br/><br />
<strong>CSS Animation</strong><br />
Until above step we&#8217;ve a list of nice buttons but since they don&#8217;t have animation with them, the opacity transition and widening effects will not seen. So we&#8217;ll add the animation effect into each button, in this example each button represented by anchor element (&lt;a&gt;) it means we&#8217;ll put the animation on anchor style.</a></p>
<pre name="code" class="css">#menu-css li a {

	/* Animation (Webkit, Gecko &amp; Mozilla) */
	-webkit-transition-duration: 0.20s;
	-webkit-transition-timing-function: ease-out;
	-moz-transition-duration: 0.20s;
	-moz-transition-timing-function: ease-out;
}</pre>
<p><strong>-webkit</strong> for Webkit-based browser and <strong>-moz</strong> for Mozilla-based browser. The <strong>trasition-duration</strong> represent how long the transition should last and <strong>transition-timing-function</strong> represent how the animation will proceed over time. On the CSS above we just create the animation in 0.20 seconds with <strong>ease-out</strong> function.</p>
<p>These step will add animation into any style changes and make them animate. For example the anchor has property width with value 20px and the anchor has different style when user hover it (ie : width: 40px), the width changes from 20px to 40px will be animated.</p>
<pre name="code" class="css">#menu-css li {
	display: inline;
	list-style: none;
}

#menu-css li a {

	/* Border Radius */
	-webkit-border-radius: 15px;
	-moz-border-radius: 15px;
	border-radius: 15px;

	/* Border Shadow */
	-webkit-box-shadow: 1px 2px 2px rgba(0,0,0,0.6);
	-moz-box-shadow: 1px 2px 2px rgba(0,0,0,0.6);
	box-shadow: 1px 2px 2px rgba(0,0,0,0.6);

	/* Animation (Webkit, Gecko &amp; Mozilla) */
	-webkit-transition-duration: 0.20s;
	-webkit-transition-timing-function: ease-out;
	-moz-transition-duration: 0.20s;
	-moz-transition-timing-function: ease-out;

	color: #ffffff;
	background: rgba(0,0,0,0.2);
	display: inline-block;
	padding: 5px 15px;
	outline: none;
	text-decoration: none;
}

	#menu-css li a:hover {
		background: rgba(0,0,0,0.5);
		padding: 5px 25px;
	}

	#menu-css li a:active {
		background: rgba(0,0,0,0.1);
		-webkit-box-shadow: 1px 1px 1px rgba(0,0,0,0.4);
		-moz-box-shadow: 1px 1px 1px rgba(0,0,0,0.4);
		box-shadow: 1px 1px 1px rgba(0,0,0,0.4);
	}</pre>
<p><br/><br />
<strong>Browser Issue</strong><br />
Since <strong>-webkit-transition</strong> has supported by latest Webkit-based browser including Safari and Chrome, Our pure CSS menu with animation above will works perfectly. Unfortunately <strong>-moz-transition</strong> <a href="https://developer.mozilla.org/en/CSS/-moz-transition" target="_blank">will be introduced</a> on Firefox 3.7 (Gecko 1.9.3) so the animation will not works on latest Firefox.</p>
<p><br/><br />
<strong>jQuery Animate</strong><br />
For a while Browser issue was disrupt our pure CSS menu, but of course we won&#8217;t stop to make it works. Using jQuery we can replace the CSS animation with <strong>$.animate()</strong> function. Surely with <strong>$.animate()</strong> function we just need to specify the pixels number for increasing the button&#8217;s padding.</p>
<p>For button opacity we can&#8217;t use opacity property in <strong>$.animate()</strong> function because it will make our button and text transparent. Since we just need to make the button (background) transparent we need <strong>$.animate()</strong> property that support <strong>rgba</strong>, we can use <a href="http://pioupioum.fr/sandbox/jquery-color/" target="_blank">Mehdi Kabab&#8217;s plugin</a> which is modification (to support rgba) from <a href="http://plugins.jquery.com/project/color" target="_blank">John Resig&#8217;s background color plugin</a>.<br />
<br/><br/></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-1845" title="rgba" src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/04/rgba.jpg" alt="rgba" width="438" height="190" /></p>
<p><br/><br/></p>
<p>If the user mouseover the button, we set its default padding and animate it by increasing its padding and opacity and when mouseout we revert to the default CSS value. When user click (mousedown) the button we decrease the opacity into 10% and revert to 50% when mouseup the button.</p>
<pre name="code" class="javascript">$(document).ready(function() {

	$('#menu-jquery li a').hover(

		function() {

			$(this).css('padding', '5px 15px')
		 .stop()
		 .animate({'paddingLeft'	: '25px',
					 'paddingRight'	: '25px',
					 'backgroundColor':'rgba(0,0,0,0.5)'},
					 'fast');
		},

		function() {

			$(this).css('padding', '5px 25px')
		 .stop()
		 .animate({'paddingLeft'	: '15px',
		 			'paddingRight'		: '15px',
		 			'backgroundColor' :'rgba(0,0,0,0.2)'},
		 			'fast');

	}).mousedown(function() {

		$(this).stop().animate({'backgroundColor': 'rgba(0,0,0,0.1)'}, 'fast');

	}).mouseup(function() {

		$(this).stop().animate({'backgroundColor': 'rgba(0,0,0,0.5)'}, 'fast');
	});
});</pre>
<p><br/><br />
<strong>Conclusion</strong><br />
CSS3 offers us many advantages but sometimes we can&#8217;t take that advantages due to browser support, thankfully for jQuery offers us the alternative. Thanks for reading and happy coding! You can get regular useful updates about web-stuff by subscribing <a href="http://feeds.feedburner.com/webstuffsharecom"><strong>webstuffshare RSS feed</strong></a> or  <a href="http://feedburner.google.com/fb/a/mailverify?uri=webstuffsharecom&amp;loc=en_US"><strong>webstuffshare FREE Email subscription</strong></a>. If you like this post, your sharing and feedback would be very appreciated <img src='http://www.webstuffshare.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webstuffshare.com/2010/04/nice-menu-css-animation-jquery-animate/feed/</wfw:commentRss>
		<slash:comments>48</slash:comments>
		</item>
		<item>
		<title>Take Control of Your Table View</title>
		<link>http://www.webstuffshare.com/2010/03/take-control-of-your-table-view/</link>
		<comments>http://www.webstuffshare.com/2010/03/take-control-of-your-table-view/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 12:13:08 +0000</pubDate>
		<dc:creator>Hidayat Sagita</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Grid]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Menu]]></category>

		<guid isPermaLink="false">http://www.webstuffshare.com/?p=1691</guid>
		<description><![CDATA[CSS Pseudo-selector come like a saviour, it makes our life easier by saving our time for traversing the Document Object Modelling (DOM). Especially for nth-child pseudo-selector, it can make us [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.webstuffshare.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/1691.jpg&amp;w=200&amp;h=150&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p>CSS Pseudo-selector come like a saviour, it makes our life easier by saving our time for traversing the Document Object Modelling (DOM). Especially for nth-child pseudo-selector, it can make us choose any element we want by pointing its index number (start from 1), it means we can easily choose any object element we want to modify.<span id="more-1691"></span></p>
<div class="button-show-implementation"><a href="http://webstuffshare.com/demo/TableView/">Show Implementation</a></div>
<div class="button-download-source"><a href="http://www.webstuffshare.com/download/TableView.zip">Download Source</a></div>
<div class="cleaner"></div>
<p>Not just CSS, jQuery also support <strong>:nth-child</strong> selector. We can use :nth-child(n) in any element we want then jQuery will search for them. For example, we have an unordered list that contains four list items and we want to modify the third element, we just need to call this script <strong>$(&#8216;li:nth-child(3)&#8217;)</strong> and your third element from the list was selected.</p>
<p style="text-align: center;"><img class="size-full wp-image-1699  aligncenter" title="image1" src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/03/image11.png" alt="image1" width="364" height="294" /></p>
<p><br/><br />
<strong>The Case</strong><br />
Each user has a different tastes in viewing our content, including data in a table. I, for example, always enjoy seeing the font in a smaller size but my friend didn&#8217;t. It just a font size, how about font style, text alignment, text color or the background color? I don&#8217;t think we need to create a user interface for each user, create a tool to stylize our table instead.</p>
<p>The tool will have a function similar to a toolbar on a text editor, it will make a font size bigger or smaller, make it bold or italic, change its alignment, adding a background color and etc. User also can choose any content they want to modify by clicking its element and modify it using the tool in the toolbar.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-1703" title="image4" src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/03/image4.png" alt="image4" width="233" height="37" /></p>
<p><br/><br />
<strong>The Technique</strong><br />
So the case we want to make a simple toolbar for stylize our table. As we know before we can traversing our every object element by jQuery pseudo-selector and jQuery tarversing function but we will use only <strong>:nth-child</strong>, <strong>parents()</strong> and <strong>children()</strong> function. The <strong>:nth-child</strong> selector we will use for choosing pointed object, <strong>parents()</strong> for choosing the selected object&#8217;s parent and <strong>children()</strong> for choosing the selected object&#8217;s children.</p>
<p>The only main task is we need to create a button and its function that can automatically <strong>adding and removing class name</strong> to the selected object.  That class which contains css properties will handle the styling of an object, so if we have a button to make the font bolder it means the button represent some css properties that will make the object bolder, and so forth.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-1700" title="image2" src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/03/image21.png" alt="image2" width="312" height="294" /></p>
<p>The selected object we divide into two section, <strong>pre-defined</strong> and <strong>user-defined</strong> selected object. In this implementation, the <strong>pre-defined</strong> selected object are <strong>&#8220;All Content&#8221;</strong> which represent all contents in the table, <strong>&#8220;Content in Column #2&#8243;</strong> which represent each contents in column number 2 and <strong>&#8220;Content in Row #2&#8243;</strong> which represent each contents in row number 3.</p>
<p><strong>User-defined</strong> selected object will represent any contents of the table selected by the user. The user will choose the object by clicking and the script will automatically save its information, row and column indexes. That informations are needed when the user want to modify the object, by these information we can locate the selected object and modify it.</p>
<p><br/><br />
<strong>CSS and jQuery</strong><br />
We prepare the HTML and CSS first, the button and the style for styling the object.</p>
<pre name="code" class="html"><span class="trigger-italic">italic</span>
<span class="trigger-strong">strong</span>
<span class="trigger-underline">underline</span></pre>
<pre name="code" class="css">span {
	display: inline-block;
	width: 23px;
	height: 23px;
	text-indent: -9999%;
	cursor: pointer
}

span:hover {
	background-position: bottom left;
}

.trigger-strong {
	background: url('images/bold.png') top left;
}

.trigger-italic {
	background: url('images/italic.png') top left;
}

.trigger-underline {
	background: url('images/underline.png') top left;
}

.trigger-background-selected{
	background: url('images/background.png') top left;
}

.trigger-italic-selected {
	background: url('images/italic.png') top left;
}

.trigger-center-selected {
	background: url('images/center.png') top left;
}</pre>
<p>The script above will create a button and some style (*-style) we will add or remove from the object. Now we add a function to the button.</p>
<pre name="code" class="javascript">$('.trigger-italic, .trigger-strong, .trigger-underline').toggle(function() {

	className =	$(this).attr('class')+'-style';

	$('td').addClass(className);
	$(this).addClass('selected');

},function() {

	$(this).removeClass('selected');

	className =	$(this).attr('class')+'-style';

	$('td').removeClass(className);

});</pre>
<p>First we add a <strong>toggle function</strong> to the button, this will make a button can be selected and unselected. If the button being selected, we will create a class name based on the button class (we just adding &#8216;-style&#8217; text for the class name). So, if the button have class name <strong>&#8216;trigger-italic&#8217;</strong> the script will generate a new class name <strong>&#8216;trigger-italic-style&#8217;</strong>. We add that class name to every <strong>&#8216;td&#8217;</strong> we have (this represent <strong>&#8216;All content&#8217;</strong>), and then add <strong>&#8216;selected&#8217;</strong> class to the button to make it look selected.</p>
<p>If the button being unselected, we just need to remove all the classes we add before. For the <strong>&#8216;Content in Column #2&#8242;</strong> we must change <strong>$(&#8216;td&#8217;)</strong> to <strong>$(&#8216;tr td:nth-child(2)&#8217;)</strong>, this will select the <strong>&#8216;td&#8217;</strong> (column) that have index number 2. For <strong>&#8216;Content in Row #3&#8242;</strong> we must change <strong>$(&#8216;td&#8217;)</strong> to <strong>$(&#8216;tr:nth-child(4)&#8217;)</strong>, this will select the <strong>&#8216;tr&#8217;</strong> (row) that have index number 3. I put index number 4 because we start counting from the row header.</p>
<pre name="code" class="javascript">$('.trigger-background-2, .trigger-right-2, .trigger-center-2').toggle(function() {

	className =	$(this).attr('class')+'-style';

	$('tr td:nth-child(2)').addClass(className);
	$(this).addClass('selected');

},function() {

	$(this).removeClass('selected');

	className =	$(this).attr('class')+'-style';

	$('tr td:nth-child(2)').removeClass(className);

});

$('.trigger-background-23, .trigger-small-23, .trigger-big-23').toggle(function() {

	className =	$(this).attr('class')+'-style';

	$('tr:nth-child(4)').children('td').addClass(className);
	$(this).addClass('selected');

},function() {

	$(this).removeClass('selected');

	className =	$(this).attr('class')+'-style';

	$('tr:nth-child(4)').children('td').removeClass(className);

});</pre>
<p>And the last is reading <strong>user-defined</strong> selected object.</p>
<pre name="code" class="javascript">$('td').click(function() {

	thisIndex 	= $(this).index() + 1;
	parentIndex	= $(this).parents('tr').index() + 1;

	$.cookie('thisIndex', thisIndex);
	$.cookie('parentIndex', parentIndex);

	$(this).append('
<div class="td-selected">Content Was Selected</div>

');
	$('.td-selected').fadeOut(1000);

});</pre>
<p>The script will locate the object by reading its index and its parent index then save it in the cookies, tell the user that they have select an object. We will add a function to the button so it can locate the selected object.</p>
<pre name="code" class="javascript">$('.trigger-background-selected, .trigger-italic-selected, .trigger-center-selected').toggle(function() {

	className	=	$(this).attr('class')+'-style';
	cookieTR		= $.cookie('parentIndex');
	cookieTD		= $.cookie('thisIndex');

	if(cookieTD != null &amp;&amp; cookieTR != null)  {
		$('tr:nth-child('+cookieTR+')').children('td:nth-child('+cookieTD+')').addClass(className);
		$(this).addClass('selected');
	} else {
		alert('Choose a content on a table first');
	}

},function() {

	$(this).removeClass('selected');

	className =	$(this).attr('class')+'-style';
	cookieTR		= $.cookie('parentIndex');
	cookieTD		= $.cookie('thisIndex');

	$('tr:nth-child('+cookieTR+')').children('td:nth-child('+cookieTD+')').removeClass(className);

});</pre>
<p>By reading the cookies that contains the object&#8217;s index informations we can locate the object and modify them.</p>
<p><br/><br />
<strong>Bug Issue for Chrome User</strong><br />
Since we&#8217;re using cookie and Chrome disable cookie on an opened file <strong>(file://)</strong> the user-predefined selected object will not working properly, to make it work put the demonstration file on your <strong>www folder</strong> an access them using <strong>http://</strong>. But you can still enable cookie on an opened file with the command line flag <strong>&#8211;enable-file-cookies</strong>. For further information please visit <a href="http://code.google.com/p/chromium/issues/detail?id=535">this following link</a>.</p>
<p>Thanks for reading! You can get regular useful updates about web-stuff by subscribing <a href="http://feeds.feedburner.com/webstuffsharecom"><strong>webstuffshare RSS feed</strong></a> or  <a href="http://feedburner.google.com/fb/a/mailverify?uri=webstuffsharecom&amp;loc=en_US"><strong>webstuffshare FREE Email subscription</strong></a>. If you like this post, your sharing and feedback would be very appreciated <img src='http://www.webstuffshare.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webstuffshare.com/2010/03/take-control-of-your-table-view/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Engage 2 CSS Positions : Relative &amp; Absolute</title>
		<link>http://www.webstuffshare.com/2010/03/engage-2-css-positions-relative-absolute/</link>
		<comments>http://www.webstuffshare.com/2010/03/engage-2-css-positions-relative-absolute/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 08:02:59 +0000</pubDate>
		<dc:creator>Hidayat Sagita</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Menu]]></category>

		<guid isPermaLink="false">http://www.webstuffshare.com/?p=1602</guid>
		<description><![CDATA[As a web developer or designer we must be frequently facing a task to create a webpage layout. In creating that, positioning a stacked-random element usually put through a nightmare [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.webstuffshare.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/1602.jpg&amp;w=200&amp;h=150&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p>As a web developer or designer we must be frequently facing a task to create a webpage layout. In creating that, positioning a stacked-random element usually put through a nightmare for us, fortunately CSS and its beautiful properties help us cure that nightmare and in this post i will explain how to take advantage of the two CSS positions, relative and absolute. <span id="more-1602"></span></p>
<div class="button-show-implementation"><a href="http://webstuffshare.com/demo/CSSPosition/">Show Implementation</a></div>
<div class="button-download-source"><a href="http://www.webstuffshare.com/download/CSSPosition.zip">Download Source</a></div>
<div class="cleaner">&nbsp;</div>
<p><strong>Relative Versus Absolute</strong><br />
Before we go to take these advantages we must be acquainted with them. I quote these two positions explanation from <a href="http://www.w3schools.com/Css/pr_class_position.asp" target="_blank">w3schools</a>, here they are :<br/><br/></p>
<blockquote style="margin-left: 3em; font-style:italic"><p><strong>Relative</strong> : Generates a relatively positioned element, positioned relative to its normal position, so &#8220;left:20&#8243; adds 20 pixels to the element&#8217;s LEFT position.</p></blockquote>
<p><br/></p>
<blockquote style="margin-left: 3em; font-style:italic"><p><strong>Absolute</strong> : Generates an absolutely positioned element, positioned relative to the first parent element that has a position other than static. The element&#8217;s position is specified with the &#8220;left&#8221;, &#8220;top&#8221;, &#8220;right&#8221;, and &#8220;bottom&#8221; properties.</p></blockquote>
<p><br/><br />
Got the point? Yes the element that have position relative will take itself  relatively positioned based on our request and its previous elements while absolute will take itself absolutely positioned based on our request where it must be positioned in our webpage.<br/><br/></p>
<p style="text-align: center;"><img class="size-full wp-image-1607  aligncenter" title="block1" src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/03/block1.png" alt="block1" width="507" height="119" /><br/><br/><br />
<img class="size-full wp-image-1608  aligncenter" title="block2" src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/03/block2.png" alt="block2" width="504" height="123" /><br/><br/><br />
<img class="size-full wp-image-1606  aligncenter" title="block 3" src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/03/block-3.png" alt="block 3" width="375" height="170" /><br/><br/></p>
<p><strong>Top, Left, Bottom or Right</strong><br />
So we can use the absolute position to put our any elements in the webpage accordance to our wishes, at this point we can use another properties such as <strong>top, left, bottom or right</strong>, unfortunately if we use these properties our element will relatively positioned with the document, then the question is how to make the element relatively positioned to the other element? <strong>In simple words our absolutely positioned element&#8217;s position will be limited by another element</strong>.</p>
<p>The question can be solved by bind the absolutely positioned element with relatively positioned element, the last element will automatically being a limiter to its absolutely positioned content and this is the advantage of engaging them. We can easily manipulate any elements to absolute position with limitation.<br/><br/></p>
<p style="text-align: center;"><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/03/block43.png" alt="block4" title="block4" width="500" height="286" class="aligncenter size-full wp-image-1636" /><br/><br/><br />
<img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/03/block53.png" alt="block5" title="block5" width="500" height="286" class="aligncenter size-full wp-image-1633" /></p>
<h3 style="padding-top: 2em; padding-bottom: 1em; color: #cc0000; text-shadow: 1px 1px #cccccc;">HTML</h3>
<pre name="code" class="html">
<div id="container">
<div class="new">&nbsp;</div>
<div class="sticky">&nbsp;</div>
<div class="get-pro">&nbsp;</div>
</div>
</pre>
<h3 style="padding-top: 2em; padding-bottom: 1em; color: #cc0000; text-shadow: 1px 1px #cccccc;">CSS</h3>
<pre name="code" class="css">
#container {
	margin-left: auto;
	margin-right: auto;
	width: 650px;
	min-height: 100px;
	background: #fff;
	padding: 5em 5em 5em 8em;
	text-align: center;
	position: relative;
}

.new {
	position: absolute;
	left: 0;
	top: 0;
	display: block;
	height: 108px;
	width: 108px;
	background: url('images/new.png') top left no-repeat;
}

.sticky {
	position: absolute;
	left: 6px;
	top: 120px;
	display: block;
	height: 213px;
	width: 218px;
	background: url('images/sticky.png') top left no-repeat;
}

.get-pro {
	position: absolute;
	right: 0;
	top: -21px;
	display: block;
	height: 185px;
	width: 90px;
	background: url('images/get-pro.png') top left no-repeat;
}
</pre>
<p>The script above will generate three elements with absolutely positioned and one element with relatively positioned, for setting these three elements position we manipulate its left, right or top properties and they will overlapping its container element that relatively positioned. We can use this tecnique (for example) to display stacked-random element, overlapping element from its container, etc.</p>
<p>That&#8217;s it, thanks for reading!  You can get regular useful updates about web-stuff by subscribing <a href="http://feeds.feedburner.com/webstuffsharecom"><strong>webstuffshare RSS feed</strong></a> or  <a href="http://feedburner.google.com/fb/a/mailverify?uri=webstuffsharecom&amp;loc=en_US"><strong>webstuffshare FREE Email subscription</strong></a>. If you like this post, your sharing and feedback would be very appreciated <img src='http://www.webstuffshare.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webstuffshare.com/2010/03/engage-2-css-positions-relative-absolute/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>jsPlumb : Connect Your HTML Elements</title>
		<link>http://www.webstuffshare.com/2010/03/jsplumb-connect-your-html-elements/</link>
		<comments>http://www.webstuffshare.com/2010/03/jsplumb-connect-your-html-elements/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 04:59:51 +0000</pubDate>
		<dc:creator>Hidayat Sagita</dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Free Stuff]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Menu]]></category>

		<guid isPermaLink="false">http://www.webstuffshare.com/?p=1597</guid>
		<description><![CDATA[jsPlumb is a jQuery plugin aim to help us connect every elements with &#8220;plumbing&#8221;, very useful for us as web developer or designer to create for example blocks node, hierarchical [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.webstuffshare.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/1597.png&amp;w=200&amp;h=150&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-1598" title="Picture 1" src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/03/Picture-110.png" alt="Picture 1" width="450" height="327" /></p>
<p><br/></p>
<p><strong><a href="http://morrisonpitt.com/jsPlumb/doc/usage.html" target="_blank">jsPlumb</a></strong> is a jQuery plugin aim to help us connect every elements with &#8220;plumbing&#8221;, very useful for us as web developer or designer to create for example blocks node, hierarchical sitemap or even randomized blocks with connected each other. jsPlumb using advantages of Canvas element and for browser-supported issue solved by using <strong><a href="http://excanvas.sourceforge.net/" target="_blank">Google&#8217;s ExplorerCanvas</a></strong> script.</p>
<p>This plugin works on most common browser including Firefox, Chrome, Safari, Opera and IE (with Google&#8217;s ExaplorerCanvas). See <a href="http://morrisonpitt.com/jsPlumb/html/demo.html" target="_blank">this</a>, <a href="http://morrisonpitt.com/jsPlumb/html/demo2.html" target="_blank">this</a> and <a href="http://morrisonpitt.com/jsPlumb/html/demo3.html" target="_blank">this</a> demo to see how jsPlumb beautifully works.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webstuffshare.com/2010/03/jsplumb-connect-your-html-elements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Code Snippet] CSS : Hover and Press Button</title>
		<link>http://www.webstuffshare.com/2010/03/code-snippet-css-hover-and-press-button/</link>
		<comments>http://www.webstuffshare.com/2010/03/code-snippet-css-hover-and-press-button/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 06:31:27 +0000</pubDate>
		<dc:creator>Hidayat Sagita</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Code Snippet]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Menu]]></category>

		<guid isPermaLink="false">http://www.webstuffshare.com/?p=1570</guid>
		<description><![CDATA[You must be familiar with css button with hovered and pressed-style, we always meet them around the internet world with ease. Fortunately, we can make them with a very simple [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.webstuffshare.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/1570.jpg&amp;w=200&amp;h=150&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p>You must be familiar with css button with hovered and pressed-style, we always meet them around the internet world with ease. Fortunately, we can make them with a very simple css technique. By using built-in css pseudo selector (<strong>:hover</strong> and <strong>:active</strong>) we can manipulate a boring link navigator into a cute one. <span id="more-1570"></span></p>
<div class="button-show-implementation"><a href="http://webstuffshare.com/demo/ButtonPressed/">Show Implementation</a></div>
<div class="button-download-source"><a href="http://www.webstuffshare.com/download/ButtonPressed.zip">Download Source</a></div>
<div class="cleaner">&nbsp;</div>
<p>As i said before we&#8217;ll use css pseudo selector, <strong>:hover</strong> and <strong>:active</strong>. <strong>:hover</strong> is a pseudo-selector to read user&#8217;s hovering action to our element while <strong>:active</strong> read pressing action. To make the button we need button image sprites as the background image, the image sprites divided into three states :  normal state, hover state and press state.</p>
<p style="text-align: center; "><img src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/03/button3.jpg" alt="button3" title="button3" width="201" height="201" class="aligncenter size-full wp-image-1590" /></p>
<p>We&#8217;ll put the image sprite as background image and play it&#8217;s position based on the user action, for example in the normal state the background image position will be set to &#8216;<strong>top left</strong>&#8216;, hover state set to &#8216;<strong>center left</strong>&#8216; and press state set to &#8216;<strong>bottom left</strong>&#8216;. These setted position will automatically set our background image position as our request.</p>
<p><img class="text-align: right" title="button2" src="http://www.webstuffshare.com/http://www.webstuffshare.com/wp-content/uploads/2010/03/button2.jpg" alt="button2" width="480" height="235" /></p>
<p>We&#8217;ll set the html into following script :</p>
<pre name="code" class="html"><a class="yellow-button" href="#">This is a Yellow Button</a></pre>
<p>And the last script is CSS :</p>
<pre name="code" class="css">.yellow-button {
	display:block;
	width: 201px;
	height: 46px;
	padding: 21px 0 0 0;
	background: url('images/yellow-button.png') top left no-repeat;
	margin-bottom: 2em;
	margin-right: 2em;
	float: left;
}

	.yellow-button:hover {
		background-position: center left;
	}

	.yellow-button:active {
		background-position: bottom left;
		padding-top: 22px;
	}</pre>
<p>Ok, that&#8217;s it, thank you for reading!  You can get regular useful updates about web-stuff by subscribing <a href="http://feeds.feedburner.com/webstuffsharecom"><strong>webstuffshare RSS feed</strong></a> or  <a href="http://feedburner.google.com/fb/a/mailverify?uri=webstuffsharecom&amp;loc=en_US"><strong>webstuffshare FREE Email subscription</strong></a>. If you like this post, your sharing and feedback would be very appreciated <img src='http://www.webstuffshare.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webstuffshare.com/2010/03/code-snippet-css-hover-and-press-button/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: www.webstuffshare.com @ 2012-02-04 18:28:08 -->
