<?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>Sam Beauvois &#187; jQuery</title>
	<atom:link href="http://www.sambeauvois.be/blog/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sambeauvois.be/blog</link>
	<description>general dev, .net and other stuff</description>
	<lastBuildDate>Tue, 27 Jul 2010 07:23:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to build a &#8220;visible on hover&#8221; action menu with jQuery ?</title>
		<link>http://www.sambeauvois.be/blog/2010/02/how-to-build-a-visible-on-hover-action-menu-with-jquery/</link>
		<comments>http://www.sambeauvois.be/blog/2010/02/how-to-build-a-visible-on-hover-action-menu-with-jquery/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 16:43:35 +0000</pubDate>
		<dc:creator>Sam Beauvois</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.sambeauvois.be/blog/?p=178</guid>
		<description><![CDATA[Here is a quick way to use jQuery library to create a &#8220;visible on hover&#8221; action menu.
I&#8217;ll explain step by step how to do that.
1.) Create an html page with actions in a container

&#60;html&#62;
 &#60;head&#62;
 &#60;title&#62;Sam Beauvois &#124; jQuery usage demo 1&#60;/title&#62;
 &#60;/head&#62;
 &#60;body&#62;
 &#60;h2&#62;Visible on hover with jQuery demo.&#60;h2&#62;
 &#60;h3&#62;Please put you mouse hover [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick way to use jQuery library to create a &#8220;visible on hover&#8221; action menu.</p>
<p>I&#8217;ll explain step by step how to do that.</p>
<p>1.) Create an html page with actions in a container</p>
<pre class="brush: xml;">
&lt;html&gt;
 &lt;head&gt;
 &lt;title&gt;Sam Beauvois | jQuery usage demo 1&lt;/title&gt;
 &lt;/head&gt;
 &lt;body&gt;
 &lt;h2&gt;Visible on hover with jQuery demo.&lt;h2&gt;
 &lt;h3&gt;Please put you mouse hover the following texts&lt;/h3&gt;
 &lt;div&gt;
 Demo 1
 &lt;div&gt;
 &lt;a href=&quot;#&quot;&gt;action 1&lt;/a&gt; | &lt;a href=&quot;#&quot;&gt;action 2&lt;/a&gt; | &lt;a href=&quot;#&quot;&gt;action 3&lt;/a&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Result is</p>
<div id="attachment_182" class="wp-caption aligncenter" style="width: 396px"><a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/02/jquery.visible.on_.hover_.demo1_.png"><img class="size-full wp-image-182" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/02/jquery.visible.on_.hover_.demo1_.png" alt="simple page" width="386" height="276" /></a><p class="wp-caption-text">simple page</p></div>
<p>2.) Link the jquery library (here from google code, but you can download the library at <a href="http://www.jquery.com" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.jquery.com?referer=');">jquery.com</a>) and add a css class to the container div and one other to the action div</p>
<pre class="brush: xml;">

&lt;head&gt;
 &lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js&quot; &gt;&lt;/script&gt;
&lt;/head&gt;
</pre>
<pre class="brush: xml;">
&lt;body&gt;
&lt;div&gt;
 Demo 1
 &lt;div&gt;
 &lt;a href=&quot;#&quot;&gt;action 1&lt;/a&gt; | &lt;a href=&quot;#&quot;&gt;action 2&lt;/a&gt; | &lt;a href=&quot;#&quot;&gt;action 3&lt;/a&gt;
 &lt;/div&gt;
 &lt;/div&gt;
&lt;/body&gt;
</pre>
<p>3.) Add a function :</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot;&gt;
 $(document).ready(function()
 {
    ShowActionOnOver();
    $(&quot;.hidden_action&quot;,this).hide(); // hide all
 });

 function ShowActionOnOver()
 {
   $(&quot;.hidden_action_container&quot;).hover(
       function()
       {
          $(&quot;.hidden_action&quot;,this).show();
       },
       function()
       {
           $(&quot;.hidden_action&quot;,this).hide();
        }
    );
 }

 &lt;/script&gt;
</pre>
<p>Now it&#8217;s functionnal, hover the zone to check :</p>
<p><a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/02/jquery.visible.on_.hover_.demo2_.png"><img class="aligncenter size-full wp-image-183" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/02/jquery.visible.on_.hover_.demo2_.png" alt="jquery.visible.on.hover.demo2" width="385" height="242" /></a></p>
<p>4.) Now, add some css to make it nicer :</p>
<pre class="brush: css;">
.hidden_action_container
{
 padding : 15px 15px 15px 15px;
 background-color: #DDDDDD;
 border-style:solid;
 border-color:#EEEEEE;
 height:50px;
}

.hidden_action a
{
 color:#999999;
 font-size: 20px;
 font-weight:bolder;
}
</pre>
<pre class="brush: xml;">
&lt;head&gt;
 &lt;link href=&quot;demo.css&quot; type=&quot;text/css&quot; rel=&quot;stylesheet&quot; /&gt;
&lt;/head&gt;
</pre>
<p>And the final result looks like</p>
<p><a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/02/jquery.visible.on_.hover_.demo3_.png"><img class="aligncenter size-full wp-image-184" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/02/jquery.visible.on_.hover_.demo3_.png" alt="jquery.visible.on.hover.demo3" width="386" height="463" /></a></p>
<h3>You can<a href="http://www.sambeauvois.be/Demos/jQuery/VisibleOnHover/demo.html" target="_blank"> see the online demo here.</a></h3>
]]></content:encoded>
			<wfw:commentRss>http://www.sambeauvois.be/blog/2010/02/how-to-build-a-visible-on-hover-action-menu-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
