Ver Mensaje Individual
  #4 (permalink)  
Antiguo 25/01/2005, 07:19
Garet
 
Fecha de Ingreso: agosto-2002
Mensajes: 74
Antigüedad: 22 años, 8 meses
Puntos: 1
No, lo he escrito no copiado

Bueno aqui dejo el codigo (las variables, van a contener el resultado de un recordset, pero esa parte todavia no la he hecho), es un script para hacer un menu:

Código:
<%@Language = VBScript %>
<%
var1="1a"
var2="2b"
var3="3c"
var4="4d"
var5="5e"
%>


<html>
<title>Maximus - IE/NS</title>

<style>
<!--
#ssm2 A {
	color:"#000000";
	text-decoration:none; 
	font-size:10;
	font-family:verdana;
	}

#ssm2 A:hover { color:"#6c6c6c"</style>
<script language="javascript1.2" src="mainMaxim.js"></script>
</head>

<body onload="init()">
	<script language="javascript1.2">
	if (IE) {document.write('<DIV ID="ssm2" style="visibility:hidden;Position : Absolute ;Left : 0px ;Top : '+YOffset+'px ;Z-Index : 20;width:1px" onmouseover="moveOut()" onmouseout="moveBack()">')}
	if (NS) {document.write('<LAYER visibility="hide" top="'+YOffset+'" name="ssm2" bgcolor="'+menuBGColor+'" left="0" onmouseover="moveOut()" onmouseout="moveBack()">')}
	tempBar=""
	for (i=0;i<barText.length;i++) {
	tempBar+=barText.substring(i, i+1)+"<BR>"}
	document.write('<table border="0" cellpadding="0" cellspacing="1" HEIGHT="100" width="'+(menuWidth+16)+'" height="100" bgcolor="'+menuBGColor+'"><tr><td bgcolor="'+hdrBGColor+'" HEIGHT="15" WIDTH="'+menuWidth+'">&nbsp;<font face="'+hdrFontFamily+'" Size="'+hdrFontSize+'" COLOR="'+hdrFontColor+'"><b>'+menuHeader+'</b></font></td><td align="center" rowspan="100" HEIGHT="15" width="16" bgcolor="'+barBGColor+'"><p align="center"><font face="'+barFontFamily+'" Size="'+barFontSize+'" COLOR="'+barFontColor+'"><B>'+tempBar+'</B></font></p></TD></tr>')
	function addItem(text, link, target) {
	if (!target) {target=linkTarget}
	document.write('<TR><TD BGCOLOR="'+linkBGColor+'" HEIGHT="15" onmouseover="bgColor=\''+linkOverBGColor+'\'" onmouseout="bgColor=\''+linkBGColor+'\'"><ILAYER><LAYER onmouseover="bgColor=\''+linkOverBGColor+'\'" onmouseout="bgColor=\''+linkBGColor+'\'" WIDTH="100%"><FONT face="'+linkFontFamily+'" Size="'+linkFontSize+'">&nbsp;<A HREF="'+link+'" target="'+target+'" CLASS="ssm2Items">'+text+'</A></FONT></LAYER></ILAYER></TD></TR>')}
	function addHdr(text) {
	document.write('<tr><td bgcolor="'+hdrBGColor+'" HEIGHT="10" WIDTH="140">&nbsp;<font face="'+hdrFontFamily+'" Size="'+hdrFontSize+'" COLOR="'+hdrFontColor+'"><b>'+text+'</b></font></td></tr>')}
	
	//Only edit the script between HERE
	
addItem('<%=var1%>', 'http://lee?ID=<%=var1%>', '_self');
addItem('<%=var2%>', 'http://lee?ID=<%=var2%>', '_self');
addItem('<%=var3%>', 'http://lee?ID=<%=var3%>', '_self');
addItem('<%=var4%>', 'http://lee?ID=<%=var4%>, '_self');
addItem('<%=var5%>', 'http://lee?ID=<%=var5%>', '_self');
	
	
	// and HERE! No more!
	
	document.write('<tr><td bgcolor="'+hdrBGColor+'"><font size="0" face="Arial">&nbsp;</font></td></TR></table>')
	if (IE) {document.write('</DIV>')}
	if (NS) {document.write('</LAYER>')}
	if ((IE||NS) && (menuIsStatic=="yes"&&staticMode)) {makeStatic(staticMode);}
	</script>
</body>
</html>
Y mainMaxim.js contiene:

Código:
function MM_displayStatusMsg(msgStr) { 
  status=msgStr;
  document.MM_returnValue = true;
}

function highlight(x){
document.forms[x].elements[0].focus()
document.forms[x].elements[0].select()
}

function MM_jumpMenu(targ,selObj,restore){ 
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

var NS
IE=document.all;
NS=document.layers;


YOffset=80; // no quotes!!
staticMode="advanced"
staticYOffset=20; // no quotes!!
slideSpeed=5 // no quotes!!
waitTime=200; // no quotes!! this sets the time the menu stays out for after the mouse goes off it.
menuBGColor="black";
menuIsStatic="yes";
menuWidth=180; // Must be a multiple of 10! no quotes!!
menuHeader="Últimos 5 temas"
hdrFontFamily="Verdana";
hdrFontSize="1";
hdrFontColor="white";
hdrBGColor="#EB632D";
hdrAlign="left";
hdrVAlign="center";
hdrHeight="1";
linkFontFamily="Verdana";
linkFontSize="2";
linkBGColor="white";
linkOverBGColor="#6C6C6C";
linkTarget="_top";
linkAlign="Left";
barBGColor="#FF4800";
barFontFamily="Verdana";
barFontSize="1";
barFontColor="White";
barVAlign="center";
barWidth=20; // no quotes!!
barText="-   |   -"

function moveOut() {
if (window.cancel) {
  cancel="";
}

if (window.moving2) {
  clearTimeout(moving2);
  moving2="";
}
if ((IE && ssm2.style.pixelLeft<0)||(NS && document.ssm2.left<0)) {
  if (IE) {ssm2.style.pixelLeft += (8%menuWidth);
}
if (NS) {
  document.ssm2.left += (8%menuWidth);
}

moving1 = setTimeout('moveOut()', -1)
}
else {
  clearTimeout(moving1)
  }
};

function moveBack() {
  cancel = moveBack1()
}
function moveBack1() {
  if (window.moving1) {
    clearTimeout(moving1)
}

if ((IE && ssm2.style.pixelLeft>(-menuWidth))||(NS && document.ssm2.left>(-200))) {
  if (IE) {ssm2.style.pixelLeft -= (8%menuWidth);
}
if (NS) {
  document.ssm2.left -= (8%menuWidth);
}
moving2 = setTimeout('moveBack1()', -1)}
  else {
    clearTimeout(moving2)
  }
};

lastY = 0;
function makeStatic(mode) {
if (IE) {winY = document.body.scrollTop;var NM=ssm2.style
}
if (NS) {winY = window.pageYOffset;var NM=document.ssm2
}
if (mode=="smooth") {
  if ((IE||NS) && winY!=lastY) {
    smooth = .2 * (winY - lastY);
      if(smooth > 0) smooth = Math.ceil(smooth);
    else smooth = Math.floor(smooth);
      if (IE) NM.pixelTop+=smooth;
        if (NS) NM.top+=smooth;
      lastY = lastY+smooth;
}
setTimeout('makeStatic("smooth")', 1)
}

else if (mode=="advanced") {
  if ((IE||NS) && winY>YOffset-staticYOffset) {
    if (IE) {NM.pixelTop=winY+staticYOffset
  }
if (NS) {NM.top=winY+staticYOffset
  }
}
else {
if (IE) {NM.pixelTop=YOffset
}
 if (NS) {NM.top=YOffset-7
 }
}
setTimeout('makeStatic("advanced")', 1)
 }
}

function init() {
if (IE) {
ssm2.style.pixelLeft = -menuWidth;
ssm2.style.visibility = "visible"
}
else if (NS) {
document.ssm2.left = -menuWidth;
document.ssm2.visibility = "show"
}
else {
alert('Choose either the "smooth" or "advanced" static modes!')
}
}


function MM_displayStatusMsg(msgStr) { 
  status=msgStr;
  document.MM_returnValue = true;
}
Gracias, por molestarse leyendo todo el codigo.

Última edición por Garet; 25/01/2005 a las 07:23