Foros del Web » Programando para Internet » PHP »

include PHP Y menu colapsable

Estas en el tema de include PHP Y menu colapsable en el foro de PHP en Foros del Web. Hola, soy nuevo en el foro! tengo dos consultas: 1 - Estoy por armar un sitio web donde el menu es incluido con "include". El ...
  #1 (permalink)  
Antiguo 21/04/2008, 13:56
 
Fecha de Ingreso: abril-2008
Mensajes: 11
Antigüedad: 16 años
Puntos: 0
include PHP Y menu colapsable

Hola, soy nuevo en el foro!

tengo dos consultas:
1 - Estoy por armar un sitio web donde el menu es incluido con "include". El problema es que el menu es colapsable, entonces cuando despliego un submenu e ingreso en otra seccion, vuelve a cargar el menu pero sin desplegar ese submenu. como puedo hacer para que me quede colapsada la seccion?

2 - Como puedo hacer para ver el index.php y testear la web offline?

No soy programador, soy diseñador asi que pido disculpa por mi ignorancia.



-------------------------------------------------------------------

aqui les dejo el codigo del index.php

<!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>Untitled Document</title>
</head>
<body>
<table width="791" border="0">
<tr>
<td width="351" height="537" align="left" valign="top"><?php
include("menu.htm");
?></td>
<td width="430" bgcolor="#CCCCCC">&nbsp;</td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>

-----------------------------------------------------------------------------------

Aqui el codigo del menu que seria incluido en todas las paginas:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title></title>
<style type="text/css">
body {
background-color: #FFFFFF;
margin-left: 2px;
margin-top: 2px;
margin-right: 2px;
margin-bottom: 2px;
}
.textos {
font-family: tahoma;
font-size: 12px;
}
a:link {
color: #000000;
text-decoration: none;
}
a:visited {
color: #000000;
text-decoration: none;
}
a:hover {
color: #842029;
text-decoration: none;
}
a:active {
color: #842029;
text-decoration: none;
}td img {display: block;}
</style>
<script type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
</head>
<style type="text/css">
.menutitle{
cursor:pointer;
margin-bottom: 3px;
width:182px;
text-align:left;/* */
font-family: Arial, Helvetica, sans-serif;
font-size: 1<;
background-color: #E6D6BB;
background-position: left;
font-size: 12px;
border: 0px solid #000000;
height: 14px;
text-decoration: none;
padding-top: 1px;
padding-right: 1px;
padding-bottom: 1px;
padding-left: 4px;
}

.submenu{
margin-bottom: 0.5em;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #CC0000;
text-decoration: none;
}
.style1 {color: #842029}
.style2 {color: #E6D6BB}
.menutitulo {
cursor:pointer;
margin-bottom: 3px;
width:165px;
text-align:left;/* */
font-family: tahoma;
font-size: 1<;
background-color: #CABCA5;
background-position: left;
font-size: 11px;
border: 0px solid #000000;
height: 25px;
text-decoration: none;
color: #7F1E27;
padding: 0px;
}
</style>

<script type="text/javascript">

/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
if(document.getElementById){
var el = document.getElementById(obj);
var ar = document.getElementById("masterdiv").getElementsBy TagName("span"); //DynamicDrive.com change
if(el.style.display != "block"){ //DynamicDrive.com change
for (var i=0; i<ar.length; i++){
if (ar[i].className=="submenu") //DynamicDrive.com change
ar[i].style.display = "none";
}
el.style.display = "block";
}else{
el.style.display = "none";
}
}
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(off set, end))
}
}
return returnvalue;
}

function onloadfunction(){
if (persistmenu=="yes"){
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display ="block"
}
}

function savemenustate(){
var inc=1, blockid=""
while (document.getElementById("sub"+inc)){
if (document.getElementById("sub"+inc).style.display= ="block"){
blockid="sub"+inc
break
}
inc++
}
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
document.cookie=cookiename+"="+cookievalue
}

if (window.addEventListener)
window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
window.onload=onloadfunction

if (persistmenu=="yes" && document.getElementById)
window.onunload=savemenustate

</script>
<body>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top"><table width="2" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="63" colspan="3" align="center" valign="top">&nbsp;</td>
</tr>
<tr>
<td width="6">&nbsp;</td>
<td width="198" align="left" valign="top"><!-- Keep all menus within masterdiv-->
<div id="masterdiv"> <br>
<br>
<div class="menutitle"><br>
</div>
<div class="menutitle" onClick="SwitchMenu('sub1')"><a href="publi_01.html" target="visor">seccion 1 </a><br>
</div>
<div class="menutitle" onClick="SwitchMenu('sub1')"><a href="publi_02.html" target="visor">seccion 2 </a><br>
</div>
<div class="menutitle" onClick="SwitchMenu('sub1')"><a href="publi_03.html" target="visor">seccion 3</a></div>
<div class="menutitle" onClick="SwitchMenu('sub1')"><a href="publi_04.html" target="visor">seccion 4</a></div>
<div class="menutitle" onClick="SwitchMenu('sub2')"><a href="publi_05.html" target="visor">seccion 5</a></div>
<div class="menutitle" onClick="SwitchMenu('sub3')">seccion 6</div>
<span class="submenu" id="sub3">&middot; <a href="seccion6-1.php" target="visor">Nro. 1 </a><br>
&middot; Nro. 2 <br>
&middot; Nro. 3 <br>
&middot; Nro. 4 <br>
&middot; Nro. 5 <br>
&middot; Nro. 6 <br>
<br>
</span>
<div class="menutitle" onClick="SwitchMenu('sub6')">seccion 7</div>
<span class="submenu" id="sub6">
&middot; <a href="prisma_01.html" target="visor">Nro. 1 </a><br>
&middot; Nro. 2<br>
&middot; <a href="prisma_03.html" target="visor"> Nro. 3<br>
&middot; <a href="prisma_04.html" target="visor"> Nro. 4<br>
&middot; <a href="prisma_05.html" target="visor"> Nro. 5<br>
&middot; <a href="prisma_06.html" target="visor"> Nro. 6
<br>
<br>
</span>
<div class="menutitle"></div>
</div>&nbsp;</td>
<td width="664" align="right" valign="top">&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
  #2 (permalink)  
Antiguo 22/04/2008, 08:35
Avatar de JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 2 meses
Puntos: 772
Re: include PHP Y menu colapsable

Hola plan9. Bienvenid@ al foro.

Para hacer preguntas es preferible utilizar el foro que mejor se adapte a tu duda, así podrán ayudarte más usuarios.

Muevo tu mensaje al foro de PHP desde Bienvenida a Foros del Web.

Saludos,
  #3 (permalink)  
Antiguo 22/04/2008, 08:46
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Re: include PHP Y menu colapsable

usa EasyPHP
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 05:22.