Buenas recien me inicio en esto, necesito una ayudita, espero me ayuden, es simple creo y se refiere a este tema ya iniciado. mi codigo (parte de él) es el siguiente:
Mi paginita por frame.
Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Fontanarrosa</title>
</head>
<frameset border="5" framespacing="3" rows="20%, 65%, 15%">
<frame Src="cabecera.html">
<frameset cols="25%, 75%">
<frame Src="indice.html">
<frame Src="cuerpo.html" scrolling="auto">
</frameset>
<frame Src="ayuda.html">
</frameset>
</html>
en el Frame Indice hay esto:
Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<LINK
REL="stylesheet"
HREF="estilo.css"
TYPE="text/css">
<title>Indice</title>
</head>
<body onload="Genera_lista();ocultar();" bgcolor="Gray">
<script language="Javascript">
function Seleccionar(idCbo)
{
var oCbo = window.document.getElementById(idCbo);
ocultar();
if(oCbo.value != 99)
{
oDivVisible = document.getElementById("Ejer" + oCbo.value);
oDivVisible.style.display = "block";
}
}
function ocultar()
{
aDivs=document.getElementsByTagName("div");
for(var i=0; i < aDivs.length; i++)
{
if(aDivs[i].id.indexOf("ejer")!=-1)
{
aDivs[i].style.display="none";
}
}
}
function Genera_lista()
{
oSelect = document.createElement('SELECT');
oSelect.id = "combo";
op = document.createElement("OPTION");
op.value = '99';
op.text = 'Seleccione una opción';
op.selected = true;
oSelect .options[0] = op;
aDivs=document.getElementsByTagName("div");
var cont=1;
for(var i=0; i < aDivs.length; i++)
{
if(aDivs[i].id.indexOf("ejer")!=-1)
{
sDescrip = aDivs[i].Descrip;
sNumero = aDivs[i].id.substr(4,2);
op = document.createElement("OPTION");
op.value = sNumero;
op.text = sDescrip;
oSelect.options[cont] = op;
cont++;
}
}
document.body.appendChild(oSelect );
oSelect.attachEvent('onchange', function() {Seleccionar('combo');});
}
function transponer()
{
alert ("Llamó bien a la funcion");
oTable=document.getelEmentById("Tabla");
iCantFilas= oTabla.rows.length;
iCantCols= oTable.rows[0].cols.length;
oTabla2=document.createElement("TABLE");
oTabla2.id= "Tabla2";
for (i=0; i<iCantcols; i++)
{
oFila=oTabla2.insertRow();
for (j=0; j<iCantFilas; j++)
{oCola=oFila2.insertcell();}
}
}
/*Funcion sin ser usada*/
function crea_tabla()
{
oTable = document.createElement("Table");
oTable.id="tabla";
oTable.border ="5"
oTBody = document.createElement('TBODY');
oTR = document.createElement('TR');
oTR.align ='Center';
oTR.bgColor = 'red';
oTD = document.createElement('TD');
oTD.innerText ='Cabecera que ocupa tres columnas';
oTR.appendChild(oTD);
oTBody.appendChild(oTR);
oTable.appendChild(oTBody);
document.body.appendChild(oTable );
}
</script>
<!-- Ejercicio 1 completo -->
<div id="ejer01" Descrip = "Listas UL y OL" style="display: block">
<!-- Sombra ejercicio 1 -->
<div class="caja2"></div>
<!-- Cuerpo ejercicio 1 -->
<div class="caja">
<div
class="titulo";>
Temario propuesto
</div>
<hr Size = "4" Width = "1000" Align = "Left" color="Black" NoShade>
<div
class="texto">
<ul>
<li>Formatos gráficos
<li>Mapas de imágenes
<li>Editores HTML
<ul>
<li> HotDog
<li> FrontPage
</ul>
<li>Otras <span class="negrita">herramientas</span>
</ul>
Bibliografía sugerida (Por orden de importancia)
<ol>
<li>HTML básico
<li>FrontPage a fondo
</ol>
</div>
</div>
</div>
<!-- Fin ejercicio 1 -->
<!-- Ejercicio 2 completo -->
<form>
<!-- Ejercicio 2-c completo -->
<!-- Ejercicio 2-b completo -->
<div id="ejer02" Descrip = "Links" style="display: block">
<!--Sombra ejercicio 2 -->
<div class="caja2"></div>
<!-- Cuerpo ejercicio 2 -->
<div class="caja">
<div
class="titulo";>
Links a Buscadores
</div>
<br>
<hr Size="1" Width="80%" Align="Left" Color="#ADD8E6" NoShade>
<br>
<div
class="enlaces";>
<!-- <ul> -->
<li><span class="spanLinks"><a href="http://www.yahoo.com.ar">
Yahoo </a></Span>
<li><a href="http://www.altavista.com">
Altavista
</a>
<li><a href="http://www.webcrawler.com">
Webcrawler
</a>
<!-- </ul> -->
</div>
<br>
<hr Size="2" Width="1000" Align="Left" Color="Black" NoShade>
<br>
Contactar con el autor en <a href="mailto:[email protected]"> e-Mail </a>
</div>
</div>
<div id="ejer03" Descrip = "Tabla" style="display: block">
<!--Sombra ejercicio 2 -->
<div class="caja2"></div>
<!-- Cuerpo ejercicio 2 -->
<div class="caja">
<Table
Border=1
CellPadding = 2
Width = “60%“
Height = “60%“>
<Caption ColSpan="3" class="negrita" align="top">
Ejemplo de Tabla <Img
Src = "C:\Users\Matias\Desktop\F_A_C_U_L_T_A_D\HTTP\2008\ico.jpg"
Alt ="Notas de Linux"
</Caption>
<TR
<TH ColSpan = 3>
Ejemplo de Tabla
</TH>
</TR>
<TR bordercolor="Blue" bgcolor="Red" aling="center">
<TH> Alumno </TH> <TH>Nota </TH> <TH> Regular </TH>
</TR>
<TR>
<TD> Vieira Matias </TD> <TD align="center"> 8 </TD> <TD> Si </TD>
</TR>
<TR>
<TD> Amarillo </TD> <TD aling="center"> 9 </TD> <TD> No </TD>
</TR>
</Table>
</div>
</div>
</div>
<div id="ejer05" Descrip = "Transponer" style="display: block">
<div class="caja6"></div>
<div class="caja5">
<div class="tituloblanco">
<Table id="Tabla"
Border=1
CellPadding = 2
Width = “60%“
Height = “60%“>
<Caption class="negrita" align="center">
Ejemplo de Tabla <Img
Src = "ico.jpg"
Alt ="Notas de Linux"
</Caption>
<TR bordercolor="Red" bgcolor="Blue" aling="center">
<TH> Alumno </TH> <TH>Nota </TH> <TH> Regular </TH>
</TR>
<TR>
<TD> Vieira Matias </TD> <TD align="center"> 8 </TD> <TD> Si </TD>
</TR>
<TR>
<TD> Amarillo </TD> <TD align="center"> 9 </TD> <TD> No </TD>
</TR>
</Table>
</div>
<td><tr> </tr></td>
<input type="button" value="Transponer" onclick="transponer();">
</div>
</div>
</form>
</body>
</html>
Pues en la funcion "function Seleccionar(idCbo)" muestro una Div u otra segun se seleccione en combo. pero ahora lo quiero hacer con Frame y necesito abrir estas div en el Frame "cuerpo.html" nombre: Cuerpo.
tambien tengo cada div cargada en un html distinto, div1.html, div2.html, etc... a modo que lo que encontre es abrir un html en una frame dstinta con Tarjet= pero solo encontre este metodo.
<a href="pagina.html" target="contenido">Contenido</a>
que me permite simplemente mediante Clicks en un texto con referencia y no es dinamico.
Alguien sabe que puedo agregar o que se usa para poder tomar el valor que tengo dentro de "oDivVisible", que es la conjuncion de Ejer + el idCbo del combo.
De mi idea me resulta de unir "Div" + "el indice" + ".html" y asi abrir este en una frame con tarjet, pero solo se hacer con un click en un texto y no proviniendo la accion desde un combo.