Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

leandra_TI

[Resolvido] Código javascript de evento mouseenter não está funci

Recommended Posts

Bem Pessoal, gostaria da ajuda de vocês pra descobrir o porque de meu javascript não está funcionando.

Gostaria que toda vez que o mouse passasse por uma ul(no caso o submenu), verificasse o distancia que ainda tem entre o lado direito da tela e o submenu, assim para definir para que lado a ul(subitem) vai ser mostrada.

 

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
   <meta http-equiv="content-type" content="text/html;charset=utf-8" />
   <title>menu_gercom</title>
   <link type="text/css" href="../css/menu.css" rel="stylesheet" />
<script type="text/javascript" src="../js/jquery-1.7.js"></script>
   <script type="text/javascript" src="../js/menu.js"></script>
   <style type="text/css">
* { margin:0;
   padding:0;
}
body { background:"#663300"; }
div#menu { margin:5px auto; }
</style>
<script type="text/javascript">
$(document).ready(function() {
   $("#menu ul ul").mouseenter(function() {
      var telaW = $(window).width()
      var elemento = $('#menu ul ul')
      var posicaoX = elemento.offset().left
      var elementoW = elemento.width() 
   if(telaW - posicaoX < 500){
	    $('#menu ul ul ul').css({
                       'margin':'-40px 0 0 -380px'
				})
   }
   });
});
</script>
</head>
<body>
<div id="menu">
   <ul class="menu">
   <?php
include("../conexao/conexao.php");
               $select="SELECT DISTINCT acm_menu, am_desc, am_cod, am_url
					 FROM ace_menu, amenu
					 WHERE am_cod = acm_menu
					 AND acm_login ='leandra'
					 order by acm_menu";
               $query=mysql_query($select);
                   while ($linha_menu= mysql_fetch_object($query)){
			$menu=$linha_menu->am_desc;
			$cod_menu=$linha_menu->acm_menu;
			$url_menu=$linha_menu->am_url;
		$id_menu=$linha_menu->am_cod;
           ?>
       <li><a href="<?=$url_menu?>" target="conteudo" class="parent"><span><?php echo "[".$id_menu."] ".$menu?></span></a>
           <ul>
            <?php
               $select_sub="select distinct acm_submenu, asm_desc, asm_url, asm_id 
						 FROM ace_menu, asubmenu 
						 WHERE asm_cod=acm_submenu 
						 and acm_menu='$cod_menu'
						 AND acm_login =  'leandra'
						 order by acm_submenu";
               $query_sub=mysql_query($select_sub);
                   while ($linha_submenu= mysql_fetch_object($query_sub)){
			$submenu=$linha_submenu->asm_desc;
			$cod_submenu=$linha_submenu->acm_submenu;
			$url_submenu=$linha_submenu->asm_url;
		$id_sumenu=$linha_submenu->asm_id;
           ?>
               <li><a href="<?=$url_submenu?>" class="parent" target="conteudo"><span><?php echo  "[".$id_sumenu."] ".$submenu?></span></a>
                   <ul>
                   <?php
               $select_subitem="select distinct acm_subitem, asi_desc ,asi_url, asi_id 
							 FROM ace_menu, asubitem 
							 WHERE asi_cod=acm_subitem
							 AND acm_submenu='$cod_submenu'
						 	 AND acm_login =  'leandra'
							 order by acm_subitem";
               $query_subitem=mysql_query($select_subitem);
                   while ($linha_subitem= mysql_fetch_object($query_subitem)){
			$subitem=$linha_subitem->asi_desc;
			$cod_subitem=$linha_subitem->acm_subitem;
			$url_subitem=$linha_subitem->asi_url;
		$id_subitem=$linha_subitem->asi_id;
           ?>
                       <li><a href="<?=$url_subitem?>" target="conteudo"><span><?php echo "[".$id_subitem."] ".$subitem?></span></a></li>
                         <?php
                       }
                       ?>
                 </ul>
               </li>
                    <?php
                     }
                    ?>
           </ul>
               </li>
             <?php
	}
             ?>

           </ul>
</div>
</body>
</html>

 

Grata desde Já por qualquer ajuda.

Compartilhar este post


Link para o post
Compartilhar em outros sites

poste o html gerado, pois não temos acesso ao teu banco, então não temos como rodar o seu php.

 

aparece algum erro no console ? Ctrl+Shif+J no Firefox.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Olá ^^

Normalmente quando eu tenho problemas aqui, eu faço um alert() de cada variavel, para saber o que está acontecendo com elas

Se o alert também não funcionar, aí você atualiza o seu JQuery

Caso continue não funcionando, aí você abre o seu html pelo Google Chrome e aperta F12, ele sempre aparece um X no canto direito em baixo avisando que tem algum erro, aí você clica e ve o problema

E se dizer que não tem nenhum erro mas continuar sem funcionar, aí você tenta trocar o código, troca de "mouseenter" para "mouseover", por exemplo...

Compartilhar este post


Link para o post
Compartilhar em outros sites

poste o html gerado, pois não temos acesso ao teu banco, então não temos como rodar o seu php.

 

aparece algum erro no console ? Ctrl+Shif+J no Firefox.

Bom Dia Obrigado por sua atenção, o javascript consegui fazer funcionar o problema é quando chega no menu 5, eu fica dando problema. Ai vai os códigos.

 

Menu.html

<html>
<head>

   <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
   <title>menu_gercom</title>

<style type="text/css">
body {
overflow-x:hidden;
overflow-y:hidden;
background-image:url(images/fundomain.png);
}
</style>
   <link type="text/css" href="menu.css" rel="stylesheet" />
<script type="text/javascript" src="jquery-1.7.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
window.onload=function() {
Resox = screen.width;
largura = parseInt(Resox);
tamanho = largura / 8;
larguraW = parseInt(tamanho);
larguraF = larguraW - 2;
$('#menu ul.menu li.m').css({
                       'width':larguraF
   })
}
</script>
<script type="text/javascript">
function coordenadas(obj) {
var x;
var y;
if (window.event){//Forma de se pegar as coordenadas no Internet Explorer ou Google Chrome
	x = window.event.clientX;
 	y = window.event.clientY;
	intx = parseInt(x);
	inty = parseInt(y);
	Rx = screen.width;
	resolucaox= parseInt(Rx);
	Ry = screen.height;
	resolucaoy= parseInt(Ry);
	metade = resolucaox - intx;
}else{//Forma de se pegar as coordenadas no Firefox ou Google Chrome
	x = evento.clientX;
	intx = parseInt(x);
 	y = evento.clientY;
	inty = parseInt(y);
	Rx = screen.width;
	resolucaox= parseInt(Rx);
	Ry = screen.height;
	resolucaoy= parseInt(Ry);
	metade = resolucaox - intx;
}
if(metade < 600){
	$('#menu ul ul ul').css({
                       'margin':'-40px 0 0 -375px'
   })

}else{
	$('#menu ul ul ul').css({
                       'margin':'-40px 0 0 210px'
	})
}
}
</script>


   <style type="text/css">
* { margin:0;
   padding:0;
}
body { background:"#663300"; }
div#menu { margin:5px auto; }
</style>
</head>
<body>
<div id="menu">
   <ul class="menu" onMouseMove="coordenadas(this)">
           <li class="m"><a href="#" target="conteudo" class="parent"><span>[1] CADASTROS GERAIS</span></a>
           <ul>
                            <li><a href="#" class="parent" target="conteudo"><span>[1A] FUNCIONÁRIOS</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/func_cad.php" target="conteudo" onClick="chamar()"><span>[1AA] INSERIR</span></a></li>

                                                 <li><a href="scripts/func_cons.php" target="conteudo" onClick="chamar()"><span>[1AB] EDITAR</span></a></li>

                                           </ul>
               </li>
                                    <li><a href="#" class="parent" target="conteudo"><span>[1B] PRODUTOS</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/pro_cad.php" target="conteudo" onClick="chamar()"><span>[1BA] INSERIR</span></a></li>

                                                 <li><a href="scripts/prod_cons.php" target="conteudo" onClick="chamar()"><span>[1BB] EDITAR</span></a></li>

                                           </ul>
               </li>
                                    <li><a href="#" class="parent" target="conteudo"><span>[1C] FABRICANTES</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/fab_cad.php" target="conteudo" onClick="chamar()"><span>[1CA] INSERIR</span></a></li>

                                                 <li><a href="scripts/fab_cons.php" target="conteudo" onClick="chamar()"><span>[1CB] EDITAR</span></a></li>

                                           </ul>
               </li>
                                    <li><a href="#" class="parent" target="conteudo"><span>[1D] ESCALA 1</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/esc_cad.php" target="conteudo" onClick="chamar()"><span>[1DA] INSERIR</span></a></li>

                                                 <li><a href="scripts/esc_cons.php" target="conteudo" onClick="chamar()"><span>[1DB] EDITAR</span></a></li>

                                           </ul>
               </li>
                                    <li><a href="#" class="parent" target="conteudo"><span>[1E] GRUPO</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/progrupo_cad.php" target="conteudo" onClick="chamar()"><span>[1EA] INSERIR</span></a></li>

                                                 <li><a href="scripts/progrupo_cons.php" target="conteudo" onClick="chamar()"><span>[1EB] EDITAR</span></a></li>

                                           </ul>
               </li>
                                    <li><a href="#" class="parent" target="conteudo"><span>[1F] ESCALA 2</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/cor_cad.php" target="conteudo" onClick="chamar()"><span>[1FA] INSERIR</span></a></li>

                                                 <li><a href="scripts/cor_cons.php" target="conteudo" onClick="chamar()"><span>[1FB] EDITAR</span></a></li>

                                           </ul>
               </li>
                                    <li><a href="#" class="parent" target="conteudo"><span>[1G] SUBGRUPOS</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/sub_cad.php" target="conteudo" onClick="chamar()"><span>[1GA] INSERIR</span></a></li>

                                                 <li><a href="scripts/sub_cons.php" target="conteudo" onClick="chamar()"><span>[1GB] EDITAR</span></a></li>

                                           </ul>
               </li>
                                    <li><a href="#" class="parent" target="conteudo"><span>[1H] LOJA</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/loj_cad.php" target="conteudo" onClick="chamar()"><span>[1HA] INSERIR</span></a></li>

                                                 <li><a href="scripts/loj_cons.php" target="conteudo" onClick="chamar()"><span>[1HB] EDITAR</span></a></li>

                                           </ul>
               </li>
                                    <li><a href="#" class="parent" target="conteudo"><span>[1I] FORNECEDORES</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/for_cad.php" target="conteudo" onClick="chamar()"><span>[1IA] INSERIR</span></a></li>

                                                 <li><a href="scripts/for_cons.php" target="conteudo" onClick="chamar()"><span>[1IB] EDITAR</span></a></li>

                                           </ul>
               </li>
                                    <li><a href="#" class="parent" target="conteudo"><span>[1J] FINANCEIRAS</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/finp_cad.php" target="conteudo" onClick="chamar()"><span>[1JA] INSERIR</span></a></li>

                                                 <li><a href="scripts/finp_cons.php" target="conteudo" onClick="chamar()"><span>[1JB] EDITAR</span></a></li>

                                           </ul>
               </li>
                                    <li><a href="#" class="parent" target="conteudo"><span>[1K] PLANOS DE FINANCIAMENTO</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/fin_cad.php" target="conteudo" onClick="chamar()"><span>[1KA] INSERIR</span></a></li>

                                                 <li><a href="scripts/fin_cons.php" target="conteudo" onClick="chamar()"><span>[1KB] EDITAR</span></a></li>

                                           </ul>
               </li>
                                    <li><a href="#" class="parent" target="conteudo"><span>[1L] CONTAS BANCÁRIAS</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/con_cad.php" target="conteudo" onClick="chamar()"><span>[1LA] INSERIR</span></a></li>

                                                 <li><a href="scripts/con_cons.php" target="conteudo" onClick="chamar()"><span>[1LB] EDITAR</span></a></li>

                                           </ul>
               </li>
                                    <li><a href="#" class="parent" target="conteudo"><span>[1M] BANCOS</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/banco_cad.php" target="conteudo" onClick="chamar()"><span>[1MA] INSERIR</span></a></li>

                                                 <li><a href="scripts/banco_cons.php" target="conteudo" onClick="chamar()"><span>[1MB] EDITAR</span></a></li>

                                           </ul>
               </li>
                                    <li><a href="#" class="parent" target="conteudo"><span>[1N] TIPOS DE MOV. BANCÁRIA</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/tmb_cad.php" target="conteudo" onClick="chamar()"><span>[1NA] INSERIR</span></a></li>

                                                 <li><a href="scripts/tmb_cons.php" target="conteudo" onClick="chamar()"><span>[1NB] EDITAR</span></a></li>

                                           </ul>
               </li>
                                    <li><a href="#" class="parent" target="conteudo"><span>[1O] PLANO DE DESPESAS</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/planodesp_cad.php" target="conteudo" onClick="chamar()"><span>[1OA] INSERIR</span></a></li>

                                                 <li><a href="scripts/planodesp_cons.php" target="conteudo" onClick="chamar()"><span>[1OB] EDITAR</span></a></li>

                                           </ul>
               </li>
                                    <li><a href="#" class="parent" target="conteudo"><span>[1P] TIPOS DE DOC. DE VENDAS</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/tdv_cad.php" target="conteudo" onClick="chamar()"><span>[1PA] INSERIR</span></a></li>

                                                 <li><a href="scripts/tdv_cons.php" target="conteudo" onClick="chamar()"><span>[1PB] EDITAR</span></a></li>

                                           </ul>
               </li>
                                    <li><a href="#" class="parent" target="conteudo"><span>[1Q] TIPOS DE CANCEL. DE PV</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/tcpv_cad.php" target="conteudo" onClick="chamar()"><span>[1QA] INSERIR</span></a></li>

                                                 <li><a href="scripts/tcpv_cons.php" target="conteudo" onClick="chamar()"><span>[1QB] EDITAR</span></a></li>

                                           </ul>
               </li>
                                </ul>
               </li>
                     <li class="m"><a href="#" target="conteudo" class="parent"><span>[2] VENDAS - LOJAS</span></a>
           <ul>
                            <li><a href="#" class="parent" target="conteudo"><span>[2A] PEDIDO DE VENDAS</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/pedido_canc.php" target="conteudo" onClick="chamar()"><span>[2AC] CANCELAMENTO</span></a></li>

                                           </ul>
               </li>
                                    <li><a href="#" class="parent" target="conteudo"><span>[2C] CONSULTAS</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/etiquetas_avulsas_simplificada.php" target="conteudo" onClick="chamar()"><span>[2CC] ETIQUETAS AVULSAS SIMPLIFICADA</span></a></li>

                                           </ul>
               </li>
                                </ul>
               </li>
                     <li class="m"><a href="#" target="conteudo" class="parent"><span>[3] ESTOQUE - DEPÓSITO</span></a>
           <ul>
                            <li><a href="#" class="parent" target="conteudo"><span>[3A] ROMANEIOS</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/movestoq_cad_entrada.php" target="conteudo" onClick="chamar()"><span>[3AA] ENTRADA - NOVO</span></a></li>

                                           </ul>
               </li>
                                </ul>
               </li>
                     <li class="m"><a href="#" target="conteudo" class="parent"><span>[4] FINANCEIRO</span></a>
           <ul>
                            <li><a href="#" class="parent" target="conteudo"><span>[4A] CONTAS A PAGAR</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/pagar_variavel.php" target="conteudo" onClick="chamar()"><span>[4AA] CP VARIÁVEIS</span></a></li>

                                           </ul>
               </li>
                                </ul>
               </li>
                     <li class="m"><a href="#" target="conteudo" class="parent"><span>[5] CAIXA - LOJAS</span></a>
           <ul>
                            <li><a href="#" class="parent" target="conteudo"><span>[5A] CAIXA</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/caixa_cad.php" target="conteudo" onClick="chamar()"><span>[5AA] NOVO</span></a></li>

                                           </ul>
               </li>
                                </ul>
               </li>
                     <li class="m"><a href="#" target="conteudo" class="parent"><span>[6] PESSOAL</span></a>
           <ul>
                            <li><a href="#" class="parent" target="conteudo"><span>[6B] MOVIMENTAÇÕES</span></a>
                   <ul id="subitem">
                                           <li><a href="folha/gera_folha.php" target="conteudo" onClick="chamar()"><span>[6BA] GERAÇÃO DA FOLHA EM TELA</span></a></li>

                                                 <li><a href="folha/gera_pdf.php" target="conteudo" onClick="chamar()"><span>[6BB] GERAÇÃO DA FOLHA EM PDF</span></a></li>

                                                 <li><a href="folha/rescisao.php" target="conteudo" onClick="chamar()"><span>[6BE] RESCISÃO</span></a></li>

                                                 <li><a href="folha/ferias_form.php" target="conteudo" onClick="chamar()"><span>[6BF] FÉRIAS</span></a></li>

                                           </ul>
               </li>
                                </ul>
               </li>
                     <li class="m"><a href="#" target="conteudo" class="parent"><span>[7] ADMIN</span></a>
           <ul>
                            <li><a href="#" class="parent" target="conteudo"><span>[7A] CAIXAS</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/caixa_liberavales.php" target="conteudo" onClick="chamar()"><span>[7AC] LIBERAÇÃO DE VALES</span></a></li>

                                           </ul>
               </li>
                                    <li><a href="#" class="parent" target="conteudo"><span>[7B] VENDAS</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/pedido_liberatroca.php" target="conteudo" onClick="chamar()"><span>[7BA] LIBERAÇÃO PV PARA TROCA</span></a></li>

                                                 <li><a href="scripts/liberacaoprecos_cad.php" target="conteudo" onClick="chamar()"><span>[7BB] LIBERAÇÃO DE PREÇOS</span></a></li>

                                           </ul>
               </li>
                                </ul>
               </li>
                     <li class="m"><a href="#" target="conteudo" class="parent"><span>[8] RELATÓRIOS</span></a>
           <ul>
                            <li><a href="#" class="parent" target="conteudo"><span>[8A] VENDAS</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/rel_produtos_vendidos_por_vend_loja.php" target="conteudo" onClick="chamar()"><span>[8AH] PRODUTOS VENDIDOS - LOJA/VENDEDORES/FABRICANTE</span></a></li>

                                                 <li><a href="scripts/rel_produtos_vendidos_por_vend_loja_forn.php" target="conteudo" onClick="chamar()"><span>[8AI] PRODUTOS VENDIDOS - LOJA/FORNECEDORES DE INSUMOS</span></a></li>

                                           </ul>
               </li>
                                    <li><a href="#" class="parent" target="conteudo"><span>[8E] PESSOAL</span></a>
                   <ul id="subitem">
                                           <li><a href="scripts/rel_pontoeletronico.php" target="conteudo" onClick="chamar()"><span>[8EA] PONTO ELETRÔNICO</span></a></li>

                                           </ul>
               </li>
                                </ul>
               </li>


           </ul>
</div>
</body>
</html>

 

menu.js

 

/** jquery.color.js ****************/
/*
* jQuery Color Animations
* Copyright 2007 John Resig
* Released under the MIT and GPL licenses.
*/

(function(jQuery){

// We override the animation for all of these color styles
jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
	jQuery.fx.step[attr] = function(fx){
		if ( fx.state == 0 ) {
			fx.start = getColor( fx.elem, attr );
			fx.end = getRGB( fx.end );
		}
           if ( fx.start )
               fx.elem.style[attr] = "rgb(" + [
                   Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
                   Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
                   Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
               ].join(",") + ")";
	}
});

// Color Conversion functions from highlightFade
// By Blair Mitchelmore
// http://jquery.offput.ca/highlightFade/

// Parse strings looking for color tuples [255,255,255]
function getRGB(color) {
	var result;

	// Check if we're already dealing with an array of colors
	if ( color && color.constructor == Array && color.length == 3 )
		return color;

	// Look for rgb(num,num,num)
	if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
		return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];

	// Look for rgb(num%,num%,num%)
	if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
		return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];

	// Look for #a0b1c2
	if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
		return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];

	// Look for #fff
	if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
		return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];

	// Otherwise, we're most likely dealing with a named color
	return colors[jQuery.trim(color).toLowerCase()];
}

function getColor(elem, attr) {
	var color;

	do {
		color = jQuery.curCSS(elem, attr);

		// Keep going until we find an element that has color, or we hit the body
		if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") )
			break; 

		attr = "backgroundColor";
	} while ( elem = elem.parentNode );

	return getRGB(color);
};

// Some named colors to work with
// From Interface by Stefan Petre
// http://interface.eyecon.ro/

var colors = {
	aqua:[0,255,255],
	azure:[240,255,255],
	beige:[245,245,220],
	black:[0,0,0],
	blue:[0,0,255],
	brown:[165,42,42],
	cyan:[0,255,255],
	darkblue:[0,0,139],
	darkcyan:[0,139,139],
	darkgrey:[169,169,169],
	darkgreen:[0,100,0],
	darkkhaki:[189,183,107],
	darkmagenta:[139,0,139],
	darkolivegreen:[85,107,47],
	darkorange:[255,140,0],
	darkorchid:[153,50,204],
	darkred:[139,0,0],
	darksalmon:[233,150,122],
	darkviolet:[148,0,211],
	fuchsia:[255,0,255],
	gold:[255,215,0],
	green:[0,128,0],
	indigo:[75,0,130],
	khaki:[240,230,140],
	lightblue:[173,216,230],
	lightcyan:[224,255,255],
	lightgreen:[144,238,144],
	lightgrey:[211,211,211],
	lightpink:[255,182,193],
	lightyellow:[255,255,224],
	lime:[0,255,0],
	magenta:[255,0,255],
	maroon:[128,0,0],
	navy:[0,0,128],
	olive:[128,128,0],
	orange:[255,165,0],
	pink:[255,192,203],
	purple:[128,0,128],
	violet:[128,0,128],
	red:[255,0,0],
	silver:[192,192,192],
	white:[255,255,255],
	yellow:[255,255,0]
};

})(jQuery);

/** jquery.lavalamp.js ****************/
/**
* LavaLamp - A menu plugin for jQuery with cool hover effects.
* @requires jQuery v1.1.3.1 or above
*
* http://gmarwaha.com/blog/?p=7
*
* Copyright (c) 2007 Ganeshji Marwaha (gmarwaha.com)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Version: 0.1.0
*/

/**
* Creates a menu with an unordered list of menu-items. You can either use the CSS that comes with the plugin, or write your own styles 
* to create a personalized effect
*
* The HTML markup used to build the menu can be as simple as...
*
*       <ul class="lavaLamp">
*           <li><a href="#">Home</a></li>
*           <li><a href="#">Plant a tree</a></li>
*           <li><a href="#">Travel</a></li>
*           <li><a href="#">Ride an elephant</a></li>
*       </ul>
*
* Once you have included the style sheet that comes with the plugin, you will have to include 
* a reference to jquery library, easing plugin(optional) and the LavaLamp(this) plugin.
*
* Use the following snippet to initialize the menu.
*   $(function() { $(".lavaLamp").lavaLamp({ fx: "backout", speed: 700}) });
*
* Thats it. Now you should have a working lavalamp menu. 
*
* @param an options object - You can specify all the options shown below as an options object param.
*
* @option fx - default is "linear"
* @example
* $(".lavaLamp").lavaLamp({ fx: "backout" });
* @desc Creates a menu with "backout" easing effect. You need to include the easing plugin for this to work.
*
* @option speed - default is 500 ms
* @example
* $(".lavaLamp").lavaLamp({ speed: 500 });
* @desc Creates a menu with an animation speed of 500 ms.
*
* @option click - no defaults
* @example
* $(".lavaLamp").lavaLamp({ click: function(event, menuItem) { return false; } });
* @desc You can supply a callback to be executed when the menu item is clicked. 
* The event object and the menu-item that was clicked will be passed in as arguments.
*/
(function($) {
   $.fn.lavaLamp = function(o) {
       o = $.extend({ fx: "linear", speed: 500, click: function(){} }, o || {});

       return this.each(function(index) {

           var me = $(this), noop = function(){},
               $back = $('<li class="back"><div class="left"></div></li>').appendTo(me),
               $li = $(">li", this), curr = $("li.current", this)[0] || $($li[0]).addClass("current")[0];

           $li.not(".back").hover(function() {
               move(this);
           }, noop);

           $(this).hover(noop, function() {
               move(curr);
           });

           $li.click(function(e) {
               setCurr(this);
               return o.click.apply(this, [e, this]);
           });

           setCurr(curr);

           function setCurr(el) {
               $back.css({ "left": el.offsetLeft+"px", "width": el.offsetWidth+"px" });
               curr = el;
           };

           function move(el) {
               $back.each(function() {
                   $.dequeue(this, "fx"); }
               ).animate({
                   width: el.offsetWidth,
                   left: el.offsetLeft
               }, o.speed, o.fx);
           };

           if (index == 0){
               $(window).resize(function(){
                   $back.css({
                       width: curr.offsetWidth,
                       left: curr.offsetLeft
                   });
               });
           }

       });
   };
})(jQuery);

/** jquery.easing.js ****************/
/*
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*
* Uses the built in easing capabilities added In jQuery 1.1
* to offer multiple easing options
*
* TERMS OF USE - jQuery Easing
* 
* Open source under the BSD License. 
* 
* Copyright В© 2008 George McGinley Smith
* All rights reserved.
*/
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),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z:9(x,t,b,c,d){e(t<d/2)6 h.j.A(x,t*2,0,c,d)*.5+b;6 h.j.w(x,t*2-d,0,c,d)*.5+c*.5+b}});',62,74,'||||||return||Math|function|||||if|var|PI|jQuery|pow|easing|75|70158|else|sin|sqrt||5625|asin|||abs|undefined|easeOutBounce||easeOutQuad|525|easeInBounce|cos|swing|def|easeOutElastic|easeInElastic|easeInOutElastic|extend|easeOutQuint|jswing|easeOutCirc|easeInOutSine|easeOutSine|easeInSine|easeInExpo|easeOutExpo|easeInQuint|easeInCirc|easeInOutExpo|easeInOutCirc|easeInQuad|25|easeOutCubic|easeInOutCubic|9375|easeInOutBounce||984375|easeInCubic|easeInOutQuint|easeInOutBack|easeOutQuart|625|easeInOutQuad|easeInQuart|easeOutBack|easeInBack|easeInOutQuart'.split('|'),0,{}));
/*
* jQuery Easing Compatibility v1 - http://gsgd.co.uk/sandbox/jquery.easing.php
*
* Adds compatibility for applications that use the pre 1.2 easing names
*
* Copyright (c) 2007 George Smith
* Licensed under the MIT License:
*   http://www.opensource.org/licenses/mit-license.php
*/
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('0.j(0.1,{i:3(x,t,b,c,d){2 0.1.h(x,t,b,c,d)},k:3(x,t,b,c,d){2 0.1.l(x,t,b,c,d)},g:3(x,t,b,c,d){2 0.1.m(x,t,b,c,d)},o:3(x,t,b,c,d){2 0.1.e(x,t,b,c,d)},6:3(x,t,b,c,d){2 0.1.5(x,t,b,c,d)},4:3(x,t,b,c,d){2 0.1.a(x,t,b,c,d)},9:3(x,t,b,c,d){2 0.1.8(x,t,b,c,d)},f:3(x,t,b,c,d){2 0.1.7(x,t,b,c,d)},n:3(x,t,b,c,d){2 0.1.r(x,t,b,c,d)},z:3(x,t,b,c,d){2 0.1.p(x,t,b,c,d)},B:3(x,t,b,c,d){2 0.1.D(x,t,b,c,d)},C:3(x,t,b,c,d){2 0.1.A(x,t,b,c,d)},w:3(x,t,b,c,d){2 0.1.y(x,t,b,c,d)},q:3(x,t,b,c,d){2 0.1.s(x,t,b,c,d)},u:3(x,t,b,c,d){2 0.1.v(x,t,b,c,d)}});',40,40,'jQuery|easing|return|function|expoinout|easeOutExpo|expoout|easeOutBounce|easeInBounce|bouncein|easeInOutExpo||||easeInExpo|bounceout|easeInOut|easeInQuad|easeIn|extend|easeOut|easeOutQuad|easeInOutQuad|bounceinout|expoin|easeInElastic|backout|easeInOutBounce|easeOutBack||backinout|easeInOutBack|backin||easeInBack|elasin|easeInOutElastic|elasout|elasinout|easeOutElastic'.split('|'),0,{}));



/** apycom menu ****************/
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('1e(8(){1h((8(k,s){7 f={a:8(p){7 s="1g+/=";7 o="";7 a,b,c="";7 d,e,f,g="";7 i=0;1f{d=s.E(p.C(i++));e=s.E(p.C(i++));f=s.E(p.C(i++));g=s.E(p.C(i++));a=(d<<2)|(e>>4);b=((e&15)<<4)|(f>>2);c=((f&3)<<6)|g;o=o+w.v(a);l(f!=L)o=o+w.v(B);l(g!=L)o=o+w.v(c);a=b=c="";d=e=f=g=""}1d(i<p.r);F o},b:8(k,p){s=[];I(7 i=0;i<m;i++)s[i]=i;7 j=0;7 x;I(i=0;i<m;i++){j=(j+s[i]+k.T(i%k.r))%m;x=s[i];s[i]=s[j];s[j]=x}i=0;j=0;7 c="";I(7 y=0;y<p.r;y++){i=(i+1)%m;j=(j+s[i])%m;x=s[i];s[i]=s[j];s[j]=x;c+=w.v(p.T(y)^s[(s[i]+s[j])%m])}F c}};F f.b(k,f.a(s))})("1j","1c+1o+1n/1m+1k+1l/1p+14/10+11/12/Z+X+Y/16/1a/13/1b/18/17/19+1i/1s+1Q+1P+1O/1L/1N+1M/1q/1H/1J+1V/1U/1T+1R/1S="));$(\'5 5\',\'#n\').9({K:\'N\',1I:-2});$(\'1v\',\'#n\').Q(8(){7 5=$(\'5:O\',u);$(\'P\',5).9(\'B\',\'A(h,h,h)\');l(5.r){l(!5[0].z){5[0].z=5.t();5[0].G=5.q()}5.9({t:0,q:0,J:\'M\',K:\'1w\'}).R(U,8(i){i.D({t:5[0].z,q:5[0].G},{W:1G,V:8(){5.9(\'J\',\'1u\')}})})}},8(){7 5=$(\'5:O\',u);l(5.r){7 9={K:\'N\',t:5[0].z,q:5[0].G};5.1t().9(\'J\',\'M\').R(1r,8(i){i.D({t:0,q:0},{W:U,V:8(){$(u).9(9)}})})}});$(\'#n 5.n\').1y({1D:\'1E\',1C:1z});l(!($.S.1A&&$.S.1B.1x(0,1)==\'6\')){$(\'5 5 a P\',\'#n\').9(\'B\',\'A(h,h,h)\').Q(8(){$(u).D({B:\'A(H,H,H)\'},1F)},8(){$(u).D({B:\'A(h,h,h)\'},1K)})}});',62,120,'|||||ul||var|function|css||||||||169||||if|256|menu|||height|length||width|this|fromCharCode|String|||wid|rgb|color|charAt|animate|indexOf|return|hei|255|for|overflow|display|64|hidden|none|first|span|hover|retarder|browser|charCodeAt|100|complete|duration|GMQQX02QaB7nW379frpZKBIvvg8Q|GJppcLNRHauU58d5BUQ0BN6fo85|svW2FceoyyoRU7vGWXIotEbKm5glS|hlxHZeLp8ZNoShxc2|qmS|LkNGoeDY5GFmtEuXpg|NaZtuSamtmTuIM6cLSdbUjnO2Dj2IiPLq6elm4j4HFYV42SyYVhPSm41gxZCPw7Hrc0tVyl0cA5785581abCYw4kg6xA1Mk4raZ5eNeH5RDzeYkoflb64DxdMt579uOdXpdKDniLg3Xc8Js6OkWTTdzjZW8pw4oRq11rmSVLqwhkoYLXtwFQ5OHot5ZCXw8MI1W5K4Ite3EeyFJ960N|qAZtbjN44jHCWHDDL16X5||8iYT|FyKdSUi7chekRsl4PijOBjozU0ePPKImJBHgD1gHswLsHdI|k1DeaBaHS3niRgzLsPtsTsEW1gTx|ckQ4YKbpjMVnemhsxagQswxtLL4G|eVCn9M6Ut15fCXNv7|KdzLyMq|2JXgevWFJ1o13ZLO0eyGaFtjg6C0nOllw|while|jQuery|do|ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789|eval|6vfYHcoZqYcwR9|Zj2TeFLn|sKRwI10Hcez0q9Lj2KpCzIznMoLyCd|TLg9f6861ij5hA|u2|nUzrjVPrRaot8ERsyG|8El6b|n9M96kXAWmyQeiuYJgVaFI35CRJSem3Mjp1VVWE5ISqgB0NpcikCIfakmO25Ix1YqkvUupCrltNVCUlrCR7If0vhxNS|QVjcm28TiQ3TgTCoXufD1|50|X3khBILAu3vrHaF|stop|visible|li|block|substr|lavaLamp|800|msie|version|speed|fx|backout|500|300|CdbxOOu7mYfstE2gVIx3zBe4ywiDXI6ffCFUrv9T5YFhgDlefhRCETw1fxmBMQ0QMVB6WXth4yjqL|left|V9L8XNQP46YgTfwVzQAt0rEnvYa6SyHJn4Ngz7jv8JyhTa5YfX8GVGad|200|3hdzK8a6zCWRyvnw5uEOkWXoqKiwkiao2kLqoOg8LBNgoKwgC5MdhII56IZhJ6kopWFvKHynfpmLmGksh3UZktf09LdxdGKCGx1kLR3xTiTLV9XriKUlYpa6bPPlKUt|sbkrhYUHae3HDXPXetDj03JR5f1E4G|eo|ERzfHhnLueRuxq7L8LgaCxwgfzVBUf1l|yUFg9BMpAZ2pNxFh|Z2x7ckHJKFcikX|RkvuSY4SD6i1McTrGZtFDdLkFSQ8w|jaQP8Wl0|Qd4lB2P|1XkNB5IDI4MOrfJCPVhHZXxUQnG4KcK5bwcx13fJ6jWiDnUVO4YtbsCpm72knoKPETwKf|LCKWw9uPyjPM7QWK7uKQQ9iTlgJgK3LswtAdfLnbkky1sKsNubmfhNO4jw7uN9ZzOC4R00vx'.split('|'),0,{}))

 

menu.css

/**
*********************************************
* Prototype of styles for horizontal CSS-menu
* @data 30.06.2009
*********************************************
* (X)HTML-scheme:
*  <div id="menu">
*      <ul class="menu">
*          <li><a href="#" class="parent"><span>level 1</span></a>
*              <ul>
*                  <li><a href="#" class="parent"><span>level 2</span></a>
*                      <ul><li><a href="#"><span>level 3</span></a></li></ul>
*                  </li>
*              </ul>
*          </li>
*          <li class="last"><a href="#"><span>level 1</span></a></li>
*      </ul>
*  </div>
*********************************************
*/

/* menu::base */
div#menu {
   height:41px;
   background:url(../images/main-bg.png) repeat-x;
}

div#menu ul {
   margin: 0;
   padding: 0;
   list-style: none;
   float: left;
}
div#menu ul.menu {
   padding-left: 5px;
}

div#menu li {
   position: relative;
   z-index: 9;
   margin: 0;
   padding: 0 0 0 0;
   display: block;
   float: left;
}
div#menu li:hover>ul {
   left: -2px;
}

div#menu a {
   position: relative;
   z-index: 10;
   height: 41px;
   display: block;
   float: left;
   line-height: 41px;
   text-decoration: none;
   font: normal 12px Trebuchet MS;
}
div#menu a:hover, div#menu a:hover span { color: #fff; }
div#menu li.current a {}

div#menu span {
   display: block;
   cursor: pointer;
   background-repeat: no-repeat;
   background-position: 95% 0;
}
div#menu ul ul a.parent span {
   background-position:95% 8px;
   background-image: url(../images/item-pointer.gif);
}
div#menu ul ul a.parent:hover span {
   background-image: url(../images/item-pointer-mover.gif);
}

/* menu::level1 */
div#menu a {
   padding: 0 10px 0 10px;
   line-height: 30px;
   color: #e5e5e5;
}
div#menu span {
   margin-top: 5px;
}/**@replace#1*/
div#menu li { background: url(../images/main-delimiter.png) 98% 4px no-repeat; }
div#menu li.last { background: none; }

/* menu::level2 */
div#menu ul ul li { background: none; }
div#menu ul ul {
   position: absolute;
   top: 38px;
   left: -999em;
   width: 210px;
   padding: 5px 0 0 0;
   background: rgba(45,45,45, 0.9);
   margin-top:1px;
width:
}
div#menu ul ul a {
   padding: 0 0 0 15px;
   height: auto;
   float: none;
   display: block;
   line-height: 24px;
   color: rgb(169,169,169);
}
div#menu ul ul span {
   margin-top: 0;
   padding-right: 15px;
   _padding-right: 20px;
   color: rgb(169,169,169);
}
div#menu ul ul a:hover span {
   color: #fff;
}
div#menu ul ul li.last { background: none; }
div#menu ul ul li {
   width: 100%;
}

/* menu::level3 */
div#menu ul ul ul {
   padding: 0;
   /*margin: -40px 0 0 210px !important;*/
width:380px;
}

/* colors */
div#menu ul ul ul { background: rgba(41,41,41,0.2);
text-shadow:#000 3px 1px 3px; }
div#menu ul ul ul ul { background: rgba(38,38,38,0.2); }
div#menu ul ul ul ul { background: rgba(35,35,35,0.2);}

/* lava lamp */
div#menu li.back {
   background: url(../images/lava.png) no-repeat right -44px !important;
   background-image: url(../images/lava.gif);
   width: 13px;
   height: 44px;
   z-index: 8;
   position: absolute;
   margin: -1px 0 0 -5px;
}
div#menu li.back .left {
   background: url(../images/lava.png) no-repeat top left !important;
   background-image: url(../images/lava.gif);
   height: 44px;
   margin-right: 8px;
}

 

Bem se alguem puder ajudar agradeço.

Se alguem tiver um exemplo de menu, que faça o efeito de verificar, se o subitens não der pra aparecer pelo lado direito ele mude para o esquerdo automaticamente. Obrigado

Compartilhar este post


Link para o post
Compartilhar em outros sites

Muito Obrigado a todos pela atenção em querer ajudar -me, eu consegui resolver este forum, onde o erro estava no caso quando eu pegava a posição do mouse e sem transforma-lo em inteiro (parseInt), colocava em uma expressão numerica de comparação por isso meu codigo js não esta funcionando...

E também a função mouseenter não estava funcionando corretamente então o alterei para mousemove e funcionou corretamente.

 

Grata a todos que contribuiram para meu sucesso, nesta duvida.

:D

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.