<?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>Random musings &#187; Javascript</title>
	<atom:link href="http://www.obaidahmed.com/programming/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.obaidahmed.com</link>
	<description>Pakistan, Startups, Entrepreneurship, Food and more...</description>
	<lastBuildDate>Wed, 07 Jul 2010 14:35:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>

   <image>
    <title>Random musings</title>
    <url>http://1.gravatar.com/avatar/5dcdb41fe2216800f9e9d8980585c425?s=48&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536</url>
    <link>http://www.obaidahmed.com</link>
   </image>
		<item>
		<title>Google Wave &#8211; What Does It Mean?</title>
		<link>http://www.obaidahmed.com/2009/05/29/google-wave-what-does-it-mean/</link>
		<comments>http://www.obaidahmed.com/2009/05/29/google-wave-what-does-it-mean/#comments</comments>
		<pubDate>Fri, 29 May 2009 14:58:36 +0000</pubDate>
		<dc:creator>Obaid</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[excited]]></category>
		<category><![CDATA[google wave]]></category>

		<guid isPermaLink="false">http://www.obaidahmed.com/?p=272</guid>
		<description><![CDATA[<p>If you are a nerd, or a technology enthusiast, then you must have heard about Google Wave. I mean literally it was all across the web, from twitter to techcrunch (aren't they both the same?) Anyways, if somehow you missed it here is a video that you... <a href="http://www.obaidahmed.com/2009/05/29/google-wave-what-does-it-mean/">Read more</a></p>]]></description>
			<content:encoded><![CDATA[<p>If you are a nerd, or a technology enthusiast, then you must have heard about <a href="http://wave.google.com">Google Wave</a>. I mean literally it was all across the web, from twitter to techcrunch (aren&#8217;t they both the same?) Anyways, if somehow you missed it here is a video that you must watch.</p>
<p><object width="480" height="295" data="http://www.youtube.com/v/v_UyVmITiYQ&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/v_UyVmITiYQ&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /></object></p>
<p>So what is wave? why am I talking about it? While the demo itself is simply amazing and the application looks like the next generation of Gmail evolution, what excites me more than anything is behind the scene technology.</p>
<p>If you are a web developer you might remember those good old days of web, when Javascript was a &#8220;client-side validation&#8221; scripting thingy. Now with the new and upcoming HTML 5 and Javascript ECMAScript5 coming to almost all browsers, we are seeing a new powerful platform. One that can help us built really high quality web applications.</p>
<p>So what&#8217;s all that special about HTML 5?</p>
<p>To get some context around this, let me recap what we currently use. Most of the websites (pretty much all of them) are currently on HTML 4 standard &#8212; which is a decade old standard. Web has evolved therefore HTML standard needed to evolve too.</p>
<p>So HTML 5 is being developed since 2004 and so far it is still being specd out. Which means that it will change over the next year or so before it is finalized, but the guts are out there now.</p>
<p>I won&#8217;t go into a lot of details about HTML5 in this post but would like to touch upon two things that really stood out for me:</p>
<p>1. Structure</p>
<p>How many times you have defined your HTML with class/id attributes structure it with header, footer, content, sidebar etc? HTML5 fixes this issue by providing new elements for representing each of these different sections. So elements like &lt;header&gt;, &lt;nav&gt;, &lt;aside&gt;, &lt;article&gt;, &lt;footer&gt; etc.</p>
<p>Makes it better for everyone to write and read the HTML code. Search engines can target your content and designers get to leverage it as well.</p>
<p>2. Video &amp; Audio</p>
<p>We all have been embedding youtube videos for a while now. There is one in this blog post. HTML really didn&#8217;t have any way to allow embedding video and audio content easily into a website. So people had to use flash. So now in HTML5 we have an &lt;video&gt; and &lt;audio&gt; tags. Along with DOM API to manipulate and interact with the video and audio.</p>
<p>There is a lot more to the story. I will write in more details about the upcoming Javascript changes and what it means to us web developers. I am truly excited at the possibilities that it will bring to the web.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.obaidahmed.com/2009/05/29/google-wave-what-does-it-mean/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple CSS Based Dropdown Menu</title>
		<link>http://www.obaidahmed.com/2008/11/17/simple-css-based-dropdown-menu/</link>
		<comments>http://www.obaidahmed.com/2008/11/17/simple-css-based-dropdown-menu/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 21:48:30 +0000</pubDate>
		<dc:creator>Obaid</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.obaidahmed.com/?p=94</guid>
		<description><![CDATA[<p>Today while working on one of my projects, I had a problem that I wanted to solve without (or little to nothing) Javascript. It was a nice Monday afternoon sorta problem to solve. So here is a quick tutorial on how to create a dropdown menu using... <a href="http://www.obaidahmed.com/2008/11/17/simple-css-based-dropdown-menu/">Read more</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.obaidahmed.com/wp-content/uploads/2008/11/dropdown.jpg"><img class="alignleft size-medium wp-image-96" style="border: 0px solid black;" title="dropdown" src="http://www.obaidahmed.com/wp-content/uploads/2008/11/dropdown-300x211.jpg" alt="" width="300" height="211" /></a>Today while working on one of my projects, I had a problem that I wanted to solve without (or little to nothing) Javascript. It was a nice Monday afternoon sorta problem to solve.</p>
<p>So here is a quick tutorial on how to create a dropdown menu using nothing but CSS. I am not claiming that I am the only person to have figured this out. I am also not claiming that this is the best solution out there. This is just here for you to learn, and for you to tell me what/how can I improve on it. Its all about learning.</p>
<p>Here we go:</p>
<p><strong>Markup:</strong></p>
<blockquote><p>&lt;div id=&#8221;menubutton&#8221;&gt;<br />
&lt;ul class=&#8221;button&#8221;&gt;<br />
&lt;li class=&#8221;"&gt;<br />
&lt;h2&gt;&lt;a href=&#8221;#&#8221;&gt;Share / Bookmark&lt;/a&gt;&lt;/h2&gt;<br />
&lt;ul&gt;<br />
&lt;li class=&#8221;first&#8221;&gt;&lt;a href=&#8221;#&#8221;&gt;Email Friends&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&#8221;#&#8221;&gt;Facebook&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&#8221;#&#8221;&gt;Google&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&#8221;#&#8221;&gt;Delicious&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&#8221;#&#8221;&gt;Digg&lt;/a&gt;&lt;/li&gt;<br />
&lt;li class=&#8221;last&#8221;&gt;&lt;a href=&#8221;#&#8221;&gt;Stumble Upon&lt;/a&gt;&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;ul class=&#8221;button&#8221;&gt;<br />
&lt;li class=&#8221;"&gt;<br />
&lt;h2&gt;&lt;a href=&#8221;#&#8221;&gt;I am another button&lt;/a&gt;&lt;/h2&gt;<br />
&lt;ul&gt;<br />
&lt;li class=&#8221;first&#8221;&gt;&lt;a href=&#8221;#&#8221;&gt;Email Friends&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&#8221;#&#8221;&gt;Facebook&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&#8221;#&#8221;&gt;Google&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&#8221;#&#8221;&gt;Delicious&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&#8221;#&#8221;&gt;Digg&lt;/a&gt;&lt;/li&gt;<br />
&lt;li class=&#8221;last&#8221;&gt;&lt;a href=&#8221;#&#8221;&gt;Stumble Upon&lt;/a&gt;&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>The structure is a bit crude (i think) but essentially provides a &#8220;menubutton&#8221; div container that will contain all of our buttons. Each button is a <strong>UL</strong> list with an <strong>h2 </strong>element with an <strong>anchor</strong> element inside it. This provides us with a simple text heading for the button. The <strong>LI </strong>also contains another <strong>UL </strong>list that will be used as a drop down menu. For the sake of simplicity and time, I have given the first and last elements in this list class of <strong>first </strong>and <strong>last</strong> respectively. This helps in styling the button. You shall see.</p>
<p><strong>The CSS:</strong></p>
<p>The CSS for this whole this is like this:</p>
<blockquote><p>#menubutton {<br />
z-index: 30;<br />
}<br />
#menubutton ul.button, ul {<br />
list-style: none;<br />
margin: 0;<br />
padding: 0;<br />
margin-right: 5px;<br />
float: left;<br />
}<br />
#menubutton a, #menubutton h2 {<br />
margin: -2px 0 0;<br />
padding: 3px;<br />
}</p>
<p>#menubutton a {<br />
font-size: 12px;<br />
text-decoration: none;<br />
color: #3c89c8;<br />
text-align: left;<br />
}<br />
#menubutton a:hover {<br />
color: #1b325f;<br />
}<br />
#menubutton li {<br />
position: relative;<br />
}<br />
#menubutton ul.button li ul {<br />
position: absolute;<br />
}<br />
#menubutton ul.button li ul li {<br />
padding: 5px 10px 5px 5px;<br />
background-color: #fff;<br />
border-left: 1px solid #e1e1e1;<br />
border-right: 1px solid #e1e1e1;<br />
}</p>
<p>#menubutton ul.button li ul li.first {<br />
border-top: 1px solid #e1e1e1;<br />
}</p>
<p>#menubutton ul.button li ul li.last {<br />
border-bottom: 1px solid #e1e1e1;<br />
padding-bottom: 5px;<br />
}</p>
<p>div#menubutton ul.button li ul {<br />
display: none;<br />
margin-top: 0px;<br />
}</p>
<p>div#menubutton ul.button li:hover h2 {<br />
border-top: 1px solid #e1e1e1;<br />
border-right: 1px solid #e1e1e1;<br />
border-left: 1px solid #e1e1e1;<br />
}</p>
<p>div#menubutton ul.button li ul li:hover {<br />
background: #eeeeee;<br />
}</p>
<p>div#menubutton ul.button li:hover ul {<br />
display: block;<br />
}</p>
<p>div#menubutton ul.button li ul li {<br />
margin: 0;<br />
font-family: Arial, Helvetica, sans-serif;;<br />
text-align: left;<br />
width: 140px;<br />
}</p>
<p>div#menubutton ul.button li span a {<br />
display: block;<br />
}</p>
<p>li.menubutton ul {<br />
width: 140px;<br />
}</p>
<p>li.menubutton h2 {<br />
padding: 5px;<br />
}</p></blockquote>
<p>Phew, that&#8217;s a lot of CSS.. <img src='http://www.obaidahmed.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I am not going to go through the details of the CSS but going to touch on one little trick that is being used here that makes it interesting. The <strong>UL </strong>that represents the dropdown menu is initially hidden by &#8220;display: none&#8221; property. We setup over <strong>hover</strong> monitoring via css on the <strong>LI </strong>that contains the <strong>H2 </strong>title and set this property to &#8220;block&#8221;. Voila! This makes the effect simple and very powerfull.</p>
<p><a href="http://deensoft.com/lab/experiment/dropdown.html">Give it a try. See it in action. </a></p>
<p>As always, your comments/suggestions are always welcome. Maybe there is a better way to structure the CSS so that its easily themeable. But I didn&#8217;t spend that much time on this so wanted to keep it simple for my own proof of concept.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.obaidahmed.com/2008/11/17/simple-css-based-dropdown-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
