Ir para conteúdo

Arquivado

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

Patty2

[Resolvido] Menu atrás da iframe

Recommended Posts

Olá!

Já andei pesquisando pela net e encontrei uma meia-solução para o problema. Mas mesmo ao mudar o z-index e a propriedade do posicionamento o menu continua ficando atrás da iframe.

No IE não consigo ver o menu e no Firefox a inframe não aparece!! :unsure: :unsure:

Por isso peço um help para tentar resolver o problema!

 

Ficam aqui os codes:

HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Site DEDA</title>
<link href="folha.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body,td,th {
	color: #999966;
}
a:link {
	color: #CC9900;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #CC9900;
}
a:hover {
	text-decoration: underline;
	color: #CC9900;
}
a:active {
	text-decoration: none;
	color: #CC9900;
}
body {
	background-color: #999967;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style2 {
	color: #CC9900;
	font-weight: bold;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
}

-->
</style>
</head>
<body>
<div id="GERAL">
 <div id="TOPO"></div>
 <div id="barraesquerda"></div>
 <div id="Barramenu">
 <ul id="MenuBar1" class="MenuBarHorizontal">
  <li><a href="home.html" target="iframe1">Home</a>	  </li>
  <li><a href="#" class="MenuBarItemSubmenu">Massagen</a>
	<ul>
	  <li><a href="klassiche.html" target="iframe1">Klassiche Massagen</a></li>
	  <li><a href="gesicht.html" target="iframe1">Gesichtmassagen</a></li>
	  <li><a href="ganz.html" target="iframe1">Ganzkorpermassagen</a></li>
	  <li><a href="sanft.html" target="iframe1">Sanftmassagen</a></li>
	  <li><a href="fuss.html" target="iframe1">Fussreflexonenmassagen</a></li>
	  <li><a href="sensitiv.html" target="iframe1">Sensitivmassage</a></li>
	  <li><a href="manuelle.html" target="iframe1">Manuelle Lymphdrainage</a></li>
	</ul>
  </li>
  <li><a href="geschichte.html" target="iframe1">Geschichte</a> </li>
  <li><a href="praxis.html" target="iframe1">Praxis</a></li>
  <li><a href="preis.html" target="iframe1">Preis</a></li>
  <li><a href="gutscheine.html" target="iframe1">Gutscheine</a></li>
  <li><a href="team.html" target="iframe1">Team</a></li>
  <li><a href="adresse.html" target="iframe1">Adresse</a></li>
  <li><a href="links.html" target="iframe1">Links</a></li>
</ul>
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
</div>
  <div class="ESQUERDO"></div>
  <div class="MEIO">
  <div class="IFRAME">
	  <iframe src="home.html" name="iframe1" width="700" marginwidth="0" height="580" marginheight="0" scrolling="Default" frameborder="no" id="iframe1" ></iframe>
 </div>
  </div>
<div class="DIREITO"></div>
<div id="RODAPE"><br />
  <span class="style2">Massage Praxis Elida Muniz - all rights reserved - 2008/2009</span></div>

CSS

@charset "utf-8";
/* CSS Document */

#GERAL {
	background-color: #999966;
	width:950px;
	margin: 0px auto;
	position:relative;
	height:100%;
	text-align:center;

}
#TOPO {
	background-image:url(banner.jpg);
	width:950px;
	height:186px;
	position:relative;
}
#barraesquerda {
	background-image:url(barramenuesquerda.jpg);
	width:136px;
	height:44px;
	float:left;
	position:relative;
}
#Barramenu {
	background-image: url(barramenu.jpg);
	width:814px;
	height:44px;
	float:left;
	position:relative;
}
#CONTEUDO {
	width:950px;
	height:606px;
	position:relative;
}
.ESQUERDO {
	background-image: url(barraesquerda.jpg);
	width:111px;
	height:606px;
	float:left;
}
.MEIO {
	position:relative;
	background-image: url(meio.jpg);
	width:733px;
	height:606px;
	float:left;
}
.IFRAME {
	position:absolute;
	top:15px;
	left:0px;
	width:733px;
	height:606px;
	z-index:-1;
}
.DIREITO {
	background-image:url(barradireita.jpg);
	width:106px;
	height:606px;
	float:right;
}	
#RODAPE {
	background-image:url(rodape.jpg);
	color:#999966;
	width:950px;
	height:64px;
	position: relative;
	clear:both;
}

Menu feito com o Spry do DW:

/* The outermost container of the Menu Bar, an auto width box with no margin or padding */
ul.MenuBarHorizontal
{
	list-style-type: none;
	font-size: 100%;
	cursor: default;
	width: auto;
	padding-top: 13px;
	padding-right: 0;
	padding-bottom: 0px;
	padding-left: 60px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	margin-left: 0px;
}
/* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */
ul.MenuBarActive
{
	z-index: 1000;
}
/* Menu item containers, position children relative to this container and are a fixed width */
ul.MenuBarHorizontal li
{
	margin: 0;
	list-style-type: none;
	font-size: 100%;
	position: relative;
	text-align: left;
	cursor: pointer;
	width: auto;
	float: left;
	padding-top: 0px;
	padding-right: 0;
	padding-bottom: 0;
	padding-left: 0;
}
/* Submenus should appear below their parent (top: 0) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
ul.MenuBarHorizontal ul
{
	list-style-type: none;
	font-size: 100%;
	z-index: 2020;
	cursor: default;
	width: 8.2em;
	position: absolute;
	left: -1000em;
	padding-top: 0px;
	padding-right: 0;
	padding-bottom: 0;
	padding-left: 0;
	margin: 0px;
}
/* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
{
	left: auto;
}
/* Menu item containers are same fixed width as parent */
ul.MenuBarHorizontal ul li
{
	width: 11em;
}
/* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */
ul.MenuBarHorizontal ul ul
{
	position: absolute;
	margin: -5% 0 0 95%;
}
/* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible
{
	left: auto;
	top: 0;
}

/*******************************************************************************

 DESIGN INFORMATION: describes color scheme, borders, fonts

 *******************************************************************************/

/* Submenu containers have borders on all sides */
ul.MenuBarHorizontal ul
{
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	border-top-style: solid;
	border-right-style: solid;
	border-bottom-style: solid;
	border-left-style: solid;
	border-top-color: #999900;
	border-right-color: #CCC;
	border-bottom-color: #CCC;
	border-left-color: #CCC;
}
/* Menu items are a light gray block with padding and no text decoration */
ul.MenuBarHorizontal a
{
	display: block;
	cursor: pointer;
	background-color: #3C0008;
	color: #FFFFFF;
	text-decoration: none;
	width: auto;
	padding-top: 0.5em;
	padding-right: 0.75em;
	padding-bottom: 0.5em;
	padding-left: 0.75em;
	border-right-width: 1px;
	border-right-style: none;
	border-right-color: #999900;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: bold;
	border-bottom-width: 1px;
	border-bottom-style: solid;
	border-bottom-color: #999900;
}
/* Menu items that have mouse over or focus have a blue background and white text */
ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus
{
	background-color: #999900;
	color: #FFF;
}
/* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
ul.MenuBarHorizontal a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible
{
	background-color: #999900;
	color: #FFF;
}

/*******************************************************************************

 SUBMENU INDICATION: styles if there is a submenu under a given menu item

 *******************************************************************************/

/* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal a.MenuBarItemSubmenu
{
	background-image: url(SpryMenuBarDown.gif);
	background-repeat: no-repeat;
	background-position: 95% 50%;
}
/* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal ul a.MenuBarItemSubmenu
{
	background-image: url(SpryMenuBarRight.gif);
	background-repeat: no-repeat;
	background-position: 95% 50%;
}
/* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal a.MenuBarItemSubmenuHover
{
	background-image: url(SpryMenuBarDownHover.gif);
	background-repeat: no-repeat;
	background-position: 95% 50%;
}
/* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover
{
	background-image: url(SpryMenuBarRightHover.gif);
	background-repeat: no-repeat;
	background-position: 95% 50%;
}

/*******************************************************************************

 BROWSER HACKS: the hacks below should not be changed unless you are an expert

 *******************************************************************************/

/* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe */
ul.MenuBarHorizontal iframe
{
	position: absolute;
	z-index: 1010;
}
/* HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */
@media screen, projection
{
	ul.MenuBarHorizontal li.MenuBarItemIE
	{
		display: inline;
		f\loat: left;
		background: #FFF;
	}
}
Podem visualizar o site aquiCSS

Desculpem tantos codes!! http://forum.imasters.com.br/public/style_emoticons/default/blush.gif

Abraços!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Poderia ter sido apenas um code só com tudo, para n´so darmos um Ctrl+C e um Ctrl+V

 

agora vamos a solução!

 

remova todas as regras da classe IFRAME

 

pelo teste que fiz já resolve o problema!

 

abraço

Compartilhar este post


Link para o post
Compartilhar em outros sites

deve ter algum position absolute, z-index que esta dando problema

 

dê uma analisada no código

 

abraço

Compartilhar este post


Link para o post
Compartilhar em outros sites

Não Aprendiz! :mellow:

Não tenho mais nenhuma position absolute e o único z-index que existe está no menu gerado pelo Spry.

 

Será que v poderia o code que você usou e deu certo para conferir onde está o erro? Thanks!

Compartilhar este post


Link para o post
Compartilhar em outros sites

OPA!!! http://forum.imasters.com.br/public/style_emoticons/default/grin.gif

 

Problema resolvido no IE!!! já consigo ver o menu por cima da iframe http://forum.imasters.com.br/public/style_emoticons/default/clap.gif http://forum.imasters.com.br/public/style_emoticons/default/clap.gif !!

 

Mas agora surgiu outro problema, que creio ser mais fácil resolver do que esse com a iframe. No IE aparece tudo bonitinho mas no FF não!! A div meio e a iframe não aparecem.

 

Para não colocar todo o código aqui, digo como estão os valores do z-index:

A div meio tem z-index: -1

A classe iframe tem o z-index: 2

A iframe não tem nenhum z-index

o menu, feito com o Css menu generator tem o z-index: 3.

 

Agora a pergunta que não quer calar: Pq não funfa no FF????

Desde já obrigado a todos pela força que deram para resolver o problema do drop-down menu.

Podem ver o resultado: AQUI

Compartilhar este post


Link para o post
Compartilhar em outros sites

essa questão do z-index negativo exibir é que ele fica atras da ultima coisa visivel, que no seu exemplo não tem

 

por isso que funciona!

 

entendeu?

 

abraço

Compartilhar este post


Link para o post
Compartilhar em outros sites

Eu entendo o raciocínio mas quando coloco a div meio com z-index de 0 ou 1 o menu mesmo com um z-index maior fica atrás.

Este é o novo código do menu com duas posições z-index, aumentei as duas mas mesmo assim, não dá no IE. nota: eu não subi a página com estes valores:

 

body{ behavior:url("csshover2.htc"); }
.menu2 {
	float:left;
	padding:0;
	color: #FFFFFF;
	width:596px;
	clear:both;
	background-color: #3C0008;
	margin-top: 9px;
	margin-right: 0;
	margin-bottom: 0;
	margin-left: 180px;
	border-bottom-width: 1px;
	border-top-style: none;
	border-right-style: none;
	border-bottom-style: none;
	border-left-style: none;
	border-top-color: #808040;
	border-right-color: #808040;
	border-bottom-color: #808040;
	border-left-color: #808040;
} /*Color navigation bar normal mode*/
.menu2  a, .menu2 a:visited {
	font-family:Arial, Helvetica, sans-serif;
	font-style:normal;
	font-weight:bold;
	font-size:12px;
	color: #FFFFFF;
	background-color: #390007;
	text-decoration: none;
}
.menu2 ul {
	list-style-type:none;
	padding:0;
	margin:0;
}
.menu2 ul li {
	float:left;
	position:relative;
	z-index:auto !important;
	z-index:3000;
	border-right:solid 1px #808040;
	border-left:solid 1px #808040;
}
.menu2 ul li a {
	color: #FFFFFF;
	float:none !important;
	float:left;
	display:block;
	height:30px;
	line-height:30px;
	text-decoration:none;
	background-color: #3C0008;
	padding-top: 0px;
	padding-right: 10px;
	padding-bottom: 0;
	padding-left: 10px;
}
.menu2 ul li ul {
	display:none;
	border:none;
	color: #FFFFFF;
	width:1px;
	background-color: #3C0008;
}
.menu2 ul li:hover a {background-color:#808000; text-decoration:none; color:#FFFFFF;} /*Color main cells hovering mode*/
.menu2 ul li:hover ul {display:block;  position:absolute; z-index:4000;top:29px; margin-top:1px; left:0;}
.menu2 ul li:hover ul li a {
	display:block;
	width:12em;
	height:auto;
	line-height:1.3em;
	margin-left:-1px;
	padding:5px 10px 5px 10px;
	border-left:solid 1px #808040;
	border-bottom: solid 1px #808040;
	background-color:#3C0008;
	color:#FFFFFF;
} /*Color subcells normal mode*/
.menu2 ul li:hover ul li a:hover {background-color:#808000; text-decoration:none;color:#FFFFFF;} /*Color subcells hovering mode*/
.menu2 ul li a:hover {background-color:#808000; text-decoration:none;color:#FFFFFF;} /*Color main cells hovering mode*/
.menu2 ul li a:hover ul {
	display:block;
	width:12em;
	position:absolute;
	z-index:4000;
	top:29px;
	left:0;
}
.menu2 ul li ul li a:visited {
	background-color:#3C0008;
	color:#FFFFFF;
} /*Color subcells normal mode*/
.menu2 ul li a:hover ul li a {display:block; width:12em; height:1px; line-height:1.3em; padding:4px 16px 4px 16px; border-left:solid 1px #808040; border-bottom: solid 1px #808040; background-color:#804000;  color:#FFFFFF;} 
.menu2 ul li a:hover ul li a:hover {background-color:#808000; text-decoration:none;color:#FFFFFF;} /*Color subcells hovering mode*/
</style>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Boas, depois de abandonar este projecto volto para dar conta que o problema foi resolvido, introduzindo um z-index: 900 na Div #Geral. Isso fez com que o problema no Firefox deixasse de existir, aparecendo tranquilamente o menu na frente da iframe nos dois navegadores!

 

Abraços

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.