Il problema dovrebbe essere abbastanza semplice...
In ogni pagina del mio sito ho inserito un menù, uguale per tutte... Il testo del menù è troppo lungo e mi complico molto la vita quando devo modificarlo in quanto devo copiarlo su ogni pagina...
C'è un modo per scrivere il menù in una pagina x.php e farlo comparire sulle altre?
Come?
Grazie a tutti...
Il menù è
Codice PHP:
<head>
<title>Home</title>
<style>
#menuShow{
border: 0px solid black; /*bordo del menu*/
background-image: url('/Immagini/MappaLaterale.png'); width: 140px; height: 260px; /*sfondo del menu*/
padding: 15px; /*distanza dal bordo*/
font-size: 10px; /*grsnsezza testo*/
font-family: tahoma, Arial;
position: absolute;
width: auto;
height: auto;
}
#menuSelect{
border: 0px solid black;
padding: 0px;
font-size: 13px;
font-family: Verdana, Arial;
position: absolute;
width: auto;
height: auto;
}
</style>
</head>
<body>
<div align="center">
<div id="menuSelect">
<a href="#menu_open" onClick="moveOnMenu();moveOffSelector()" style="text-decoration: none">
[b]
[img]/Immagini/Men_Laterale.png[/img]</a>
</div>
<div id="menuShow">
<a href="#menu_close" onClick="moveOffMenu();moveOnSelector()" style="text-decoration: none; color:black">
[img]http://oceano1.pirateswar.com/immagini/premium_45.png[/img]   </a>
[url="/index.php"]Home  [/url]
</div>
<script>
Show ="no";
// Set OffX in pixels to a negative number
// somewhat larger than the width of the menu.
var OffX = -150;
// Set the PosX and PosY variables
// to the location on the screen where the
// menu should position (in pixels) when stopped.
var PosX = -3; //orizzontale
var PosY = 310;//verticale
// Usually, use the settings shown; but you can
// change the speed and the increment of motion
// across the screen, below.
var speed = 3;
var increment = 2;
var incrementNS4 = 5; // for slower NS4 browsers
// do not edit below this line
// ===========================
var is_NS = navigator.appName=="Netscape";
var is_Ver = parseInt(navigator.appVersion);
var is_NS4 = is_NS&&is_Ver>=4&&is_Ver<5;
var is_NS5up = is_NS&&is_Ver>=5;
var MenuX=OffX;
var SelX=PosX;
var sPosX=PosX;
var sOffX=OffX;
if (Show=="yes"){
sPosX=OffX;
sOffX=PosX;
MenuX=sOffX;
SelX=sPosX;
}
if (is_NS4){
increment=incrementNS4;
Lq="document.layers.";
Sq="";
eval(Lq+'menuSelect'+Sq+'.left=sPosX');
eval(Lq+'menuShow'+Sq+'.left=sOffX');
eval(Lq+'menuSelect'+Sq+'.top=PosY');
eval(Lq+'menuShow'+Sq+'.top=PosY');
}else{
Lq="document.all.";
Sq=".style";
document.getElementById('menuSelect').style.left=sPosX+"px";
document.getElementById('menuShow').style.left=sOffX+"px";
document.getElementById('menuSelect').style.top=PosY+"px";
document.getElementById('menuShow').style.top=PosY+"px";
}
function moveOnMenu(){
if (MenuX<PosX){
MenuX=MenuX+increment;
if (is_NS5up){
document.getElementById('menuShow').style.left=MenuX+"px";
}else{
eval(Lq+'menuShow'+Sq+'.left=MenuX');
}
setTimeout('moveOnMenu()',speed);
}
}
function moveOffMenu(){
if (MenuX>OffX){
MenuX=MenuX-increment;
if (is_NS5up){
document.getElementById('menuShow').style.left=MenuX+"px";
}else{
eval(Lq+'menuShow'+Sq+'.left=MenuX');
}
setTimeout('moveOffMenu()',speed);
}
}
function moveOffSelector(){
if (SelX>OffX){
SelX=SelX-increment;
if (is_NS5up){
document.getElementById('menuSelect').style.left=SelX+"px";
}else{
eval(Lq+'menuSelect'+Sq+'.left=SelX');
}
setTimeout('moveOffSelector()',speed);
}
}
function moveOnSelector(){
if (SelX<PosX){
SelX=SelX+increment;
if (is_NS5up){
document.getElementById('menuSelect').style.left=SelX+"px";
}else{
eval(Lq+'menuSelect'+Sq+'.left=SelX');
}
setTimeout('moveOnSelector()',speed);
}
}
</script>
</div>
</body>
Magari, nella pagina x.php, sarebbe più semplice inserire solo la parte nel body?