Mostrando Codigo - Dhtml
<?xml version = "1.0" encoding= "iso-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd">
<html xmlns= "http://www.w3.org/1999/xhtml" xml:lang = "en" >
.d1 {position:relative; top:0; width:100%; height:200px;
background-color:#666666; overflow:auto;}
.d2 {position:relative; top:0; width:100%; height:200px;
background-color:#999999; overflow:auto;}
#hr {cursor:pointer;}
<script type = "text/javascript" >
var startpos, diffpos=0;
var erlaubt = false;
function Position(Ereignis)
{
if (!document.all)
startpos = Ereignis.screenY + diffpos;
else
startpos = event.clientY + diffpos;
erlaubt = true;
return false;
}
function Aktion(Ereignis)
{
erlaubt = false;
return false;
}
function NeuPos(Ereignis)
{
if (erlaubt)
{
if (!document.all)
jetztpos = Ereignis.screenY;
else
jetztpos = event.clientY;
diffpos = startpos-jetztpos;
if (diffpos > -200 && diffpos < 200)
{
document.getElementById("d1").style.height = 200 - diffpos + "px";
document.getElementById("d2").style.height = 200 + diffpos + "px";
}
}
}
function setevent()
{
document.getElementById("hr").onmousedown = Position;
document.onmouseup = Aktion;
document.onmousemove = NeuPos;
}
<body onload = "setevent()" >
Este seria el contenido de una capa
<br / >
Mas conenido
<hr size = "5" class = "hr" id = "hr" / >
Este seria el contido de otra capa
<br / >
Mas conenido
ENLACE AL CODIGO
Si quieres enlazar desde tu pagina a este codigo
COMENTARIOS
Aun no existe ningun comentario para este Codigo.