Per la seconda parte non so se intendi questo.
codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script language="JavaScript" type="text/javascript">
<!--
function showHide(exampleNumber) {
curObj = document.getElementById('example'+exampleNumber);
curObj.style.display = curObj.style.display == 'none' ? 'block' : 'none';
} // function showHide(exampleNumber)
//---------------- Moving Menu
function checkLocation(){
if (navigator.appName == "Netscape") {
yy = window.pageYOffset;
document.getElementById('object1').style.top=yy;
} else {
yy = document.body.scrollTop;
document.getElementById('object1').style.pixelTop=yy;
}
setTimeout("checkLocation()",10)
} // function checkLocation()
function menuHideShow(td, object1) {
if (object1.style.left == movingMenuWidth+"px") {
object1.style.left = 0;
menuNameColor = td.style.color;
td.style.color = 'yellow';
} else {
object1.style.left = movingMenuWidth;
td.style.color = menuNameColor;
} // if (object1.style.left == movingMenuWidth+"px")
} // function menuHideShow(td, object1)
//-->
</script>
</head>
<body>
<div id="object1" style="position:absolute; visibility:show; left:-125px; top:0px; z-index:999">
<table summary="" style="z-index:999" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="background-color:'#FF0000'"></td>
<td colspan="3" >
<table id="movingMenu" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<input type="button" style="background-color:darkblue;color:white;font-weight:bold"
value="Show example" onclick="showHide(1)"/>
<div id="example1" style="background-color:#00ffff;display:none">
<pre>
function SearchDemo(){
var r, re; //Declare variables.
var s = "The rain in Spain falls mainly in the plain.";
re = /falls/i; //Create regular expression pattern.
r = s.search(re); //Search the string.
return(r); //Return the Boolean result.
}
</pre>
</div>
</td>
</tr>
<tr>
<td>
<input type="button" style="background-color:darkblue;color:white;font-weight:bold"
value="Show example" onclick="showHide(2)"/>
<div id="example2" style="background-color:#00ffff;display:none">
<pre>
function SetDateDemo(newdate){
var d, s; //Declare variables.
d = new Date(); //Create date object.
d.setDate(newdate); //Set date to newdate.
s = "Current setting is ";
s += d.toLocaleString();
return(s); //Return newly set date.
}
</pre>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
Salve a tutti, ho due problemi che vorrei risolvere.
1)avrei bisogno di nascondere in fase di caricamento della pagina
asp un oggetto e farlo visualizzare quando clicco su bottone.
Un esempio lo si può vedere sulle pagine di msdn tipo:
http://msdn.microsoft.com/library/d...mthsethours.asp
in questa pagina c'è un "SHOW EXAMPLE" che visualizza/nasconde il codice.
Come per l'esempio riportato non vorrei che l'oggetto (div,table ecc.)
occupasse "spazio" se non visualizzato.
2) Ho la necessità, avendo una pagina con molti dati visualizzati
quindi molto "lunga" (possibilmente senza utilizzare frame),
di avere sempre a disposizione i bottoni che sono già presenti ad
inizio e fine pagina. In definitiva vorrei che "scorressero" insieme
ai dati in modo da poterli avere a disposizione anche a metà pagina.
Grazie a tutti.
<script language="JavaScript" type="text/javascript">
<!--
document.getElementById('object1').style.left = 0;
checkLocation();
//-->
</script>
</body>
</html>