<?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>Felipe de Albuquerque &#187; menu acessível</title>
	<atom:link href="http://www.felipealbuquerque.com/tag/menu-acessivel/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.felipealbuquerque.com</link>
	<description>Front-End Engineer &#38; Designer / Web Designer / Web Developer</description>
	<lastBuildDate>Sun, 13 Mar 2011 16:01:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Menu Drop Down Acessível</title>
		<link>http://www.felipealbuquerque.com/2009/10/19/menu-drop-down-acessivel/</link>
		<comments>http://www.felipealbuquerque.com/2009/10/19/menu-drop-down-acessivel/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 19:20:24 +0000</pubDate>
		<dc:creator>Felipe de Albuquerque</dc:creator>
				<category><![CDATA[Acessibilidade]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[javaScript]]></category>
		<category><![CDATA[menu acessível]]></category>
		<category><![CDATA[web standards]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.felipealbuquerque.com/?p=223</guid>
		<description><![CDATA[Soluções inclusivas, em minha opinião são vitais para profissionais não só da web. Entre tanto o que se vê por ai não é exatamente isso, mas se você está lendo este texto é porque você está há vários passos na frente de outros profissionais, e está com o pensamento certo e inclusivo. Esta solução de]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-240" title="Acessibilidadeda" src="http://www.felipealbuquerque.com/wp-content/uploads/2009/10/acessibilidadeda-menu.jpg" alt="Acessibilidadeda" width="640" height="238" /></p>
<p>Soluções inclusivas, em minha opinião são vitais para profissionais não só da web.</p>
<p>Entre tanto o que se vê por ai não é exatamente isso, mas se você está lendo este texto é porque você está há vários passos na frente de outros profissionais, e está com o pensamento certo e inclusivo.</p>
<p>Esta solução de menu acessível é muito fácil e funciona bem em vários navegadores como no IE6 + e em todos os browsers que dão suporte a web Standards. Funciona com teclado e mouse, e se o JavaScript estiver desabilitado dá pra acessar todos os links, mas os subitens não aparecem visualmente.</p>
<p>Veja <a title="Ver o exemplo funcionando" href="http://www.felipealbuquerque.com/menuAcessivel.html" target="_blank">o menu funcionando</a> e vamos aos detalhes:</p>
<h2>XHTML</h2>
<p>É o documento de marcação onde vamos criar os nós do menu.</p>
<p>Vamos criar uma lista não ordenada “ul” e seus respectivos filhos e adicionar id e classes para podermos manipular alguns elementos.</p>
<pre><code>
<span>&lt;!-- As tags como o DOCTYPE, head, body e demais não vou descrever aqui para o post ser mais objetivo --&gt;</span>
&lt;ul id="nav"&gt;
	&lt;li&gt;&lt;a href="index.html"&gt;Home&lt;/a&gt;&lt;/li&gt;
	&lt;li class="submenu"&gt;&lt;a href="#" class="bullet"&gt;Portfólio&lt;/a&gt;
		&lt;ul&gt;
			&lt;li&gt;&lt;a href="sites.html"&gt;Sites&lt;/a&gt;&lt;/li&gt;
			&lt;li class="submenu"&gt;&lt;a href="#" class="bullet"&gt;Interfaces&lt;/a&gt;
				&lt;ul&gt;
					&lt;li&gt;&lt;a href="graficas.html"&gt;Gráficas&lt;/a&gt;&lt;/li&gt;
					&lt;li&gt;&lt;a href="digitais.html"&gt;Digitais&lt;/a&gt;&lt;/li&gt;
				&lt;/ul&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;&lt;a href="quemsomos.html"&gt;Quem Somos&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="contato.html"&gt;Contato&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>
<h2>CSS</h2>
<p>É o documento de apresentação, onde vamos posicionar e dar beleza ao nosso menu.</p>
<p>Aqui é onde você provavelmente ira mexer mais, para poder customizar seu menu acessível.</p>
<pre><code>
#nav, #nav ul {
	width: 70em;
	list-style: none;
	font: bold 12px Verdana, Arial, Helvetica, sans-serif;
	padding: 0;
	margin: 0;
 }
#nav li {
	float: left;
 }
#nav a {
	display: block;
	width: 10em;
	height: 2em;
	line-height: 2;
	text-align: center;
	text-decoration: none;
	background-color: #69c; /* IE precisa desta declaração */
	color: #fff;
	border: 1px solid #ccc;
	border-width: 0 1px 1px
 }
#nav a:hover {
	text-decoration: none;
	background: #c7daec;
	color:#69c;
 }
#nav a.bullet {
	background:#69c url(bullet.gif) no-repeat right;
 }
#nav a.bullet:hover {
	background: #c7daec url(bullet-over.gif) no-repeat right;
 }
#nav li ul {
	position: absolute;
	left: -1000em;
	width: 10em;
	margin: 0;
 }
#nav ul ul {
	margin: -2.1em 0 0 10.1em;
 }
#nav li:hover ul ul, #nav li.over ul ul {
	left: -1000em;
 }
#nav li:hover ul, #nav li li:hover ul, #nav li.over ul, #nav li li.over ul {
	left: auto;
}
</code></pre>
<h2>JavaScript</h2>
<p>O arquivo JavaScript é responsável pela ação.</p>
<p>É neste documento que vamos verificar os links e os subitens da lista e vamos fazer com que ele se encarregue em abrir os subitens.</p>
<pre><code>
&lt;script type="text/javascript"&gt;

var dropdown_intervalId;
var dropdown_ulId = (!dropdown_ulId) ? 'nav' : dropdown_ulId;
var dropdown_delay = (!dropdown_delay) ? 0 : dropdown_delay;

function dropdown_init()
{
 try
 {
  var as = document.getElementById(dropdown_ulId).getElementsByTagName('a');

  for (var a = 0; a &lt; as.length; a++)
  {
   as[a].onfocus = function() { dropdown_expand(this) }
   as[a].onmouseover = function() { dropdown_expand(this) }
   as[a].onblur = function() { dropdown_colapse(dropdown_delay) }
   as[a].onmouseout = function() { dropdown_colapse(dropdown_delay) }
  }

  dropdown_colapse(0);

 } catch(e){}

}

function dropdown_expand(caller)
{
 try
 {
  clearInterval(dropdown_intervalId);

  var uls = caller.parentNode.parentNode.getElementsByTagName('ul');

  for (var ul = 0; ul &lt; uls.length; ul++)
   uls[ul].style.left = "-1000em";

  caller.parentNode.getElementsByTagName('ul')[0].style.left = "auto";

 } catch(e){}

}

function dropdown_colapse(milliseconds)
{
 try
 {
  clearInterval(dropdown_intervalId);

  dropdown_intervalId = setInterval(function()
  {
   var uls = document.getElementById(dropdown_ulId).getElementsByTagName('ul');

   for (var ul = 0; ul &lt; uls.length; ul++)
    uls[ul].style.left = "-1000em";

   clearInterval(dropdown_intervalId);

  }, milliseconds, null);

 } catch(e){}

}

window.onload = dropdown_init;
&lt;/script&gt;

</code></pre>
<p>Esse menu foi tema de debate na lista <a title="Lista Acesso Digital" href="http://groups.google.com/group/acessodigital" target="_blank">Acesso Digital</a>, e esse post foi baseado na resposta do Gil Porta membro da lista, e o menu foi desenvolvido por <a href="http://www.alexandrejunqueira.com" target="_blank">Alexandre Junqueira</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.felipealbuquerque.com/2009/10/19/menu-drop-down-acessivel/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

