Visualizzazione dei risultati da 1 a 6 su 6

Discussione: reload all'onresize

  1. #1

    reload all'onresize

    Ciao a tutti,
    sto utilizzando da parecchio tempo questo comando:
    codice:
    <script type="text/javascript"> 
    window.onresize=function(){ 
    window.location.reload(); 
    } 
    </script>
    per far ricaricare la pagina quando viene ridimensionata la finestra.
    L'ho provato ora in un altra pagina e non mi funziona.

    Esiste qualche altro comando che abbia la stessa funzione?

    Fatemi sapere.
    Grazie mille.

  2. #2
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    21,188
    Ci possono essere vari motivi per cui non funziona: primo tra tutti l'utilizzo di un altro controllo onresize.

    Tieni presente che quello script andrebbe posto dentro al body: non credo possa funzionare se inserito nella head.
    Nuova politica di maggiore severita` sui titoli delle discussioni: (ri)leggete il regolamento
    No domande tecniche in messaggi privati

  3. #3
    L' ho sempre utilizzato nel head e va bene.

    Credo di aver capito come mai non mi ricarica la pagina; praticamente in uno script che ho nel body che gestisce il menù della pagina utilizzo questi comandi:

    codice:
    function BeforeStart(){return}
    function AfterBuild(){return}
    function BeforeFirstOpen(){return}
    function AfterCloseAll(){return}
    Cosa posso modificare?

  4. #4
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    21,188
    Stai parlando un linguaggio che non capisco.
    Non e` che quelle funzioni siano proprietarie di IE?
    Nuova politica di maggiore severita` sui titoli delle discussioni: (ri)leggete il regolamento
    No domande tecniche in messaggi privati

  5. #5
    Non credo...

    ti posto tutto lo script del menù che con mozilla e IE vedo allo benissimo stesso modo.

    codice:
    <script type='text/javascript'>
    
    function Go(){return}
    
    </script>
    <script type='text/javascript'>
    
    	var NoOffFirstLineMenus=10;			// Number of first level items
    	var LowBgColor='white';			// Background color when mouse is not over
    	var LowSubBgColor='white';			// Background color when mouse is not over on subs
    	var HighBgColor='yellow';			// Background color when mouse is over
    	var HighSubBgColor='black';			// Background color when mouse is over on subs
    	var FontLowColor='black';			// Font color when mouse is not over
    	var FontSubLowColor='black';			// Font color subs when mouse is not over
    	var FontHighColor='white';			// Font color when mouse is over
    	var FontSubHighColor='white';			// Font color subs when mouse is over
    	var BorderColor='black';			// Border color
    	var BorderSubColor='black';			// Border color for subs
    	var BorderWidth=1;				// Border width
    	var BorderBtwnElmnts=1;			// Border between elements 1 or 0
    	var FontFamily="arial,comic sans ms,technical"	// Font family menu items
    	var FontSize=9;				// Font size menu items
    	var FontBold=1;				// Bold menu items 1 or 0
    	var FontItalic=0;				// Italic menu items 1 or 0
    	var MenuTextCentered='left';			// Item text position 'left', 'center' or 'right'
    	var MenuCentered='center';			// Menu horizontal position 'left', 'center' or 'right'
    	var MenuVerticalCentered='top';		// Menu vertical position 'top', 'middle','bottom' or static
    	var ChildOverlap=0;				// horizontal overlap child/ parent
    	var ChildVerticalOverlap=0;			// vertical overlap child/ parent
    	var StartTop=58;				// Menu offset x coordinate
    	var StartLeft=0;				// Menu offset y coordinate
    	var VerCorrect=0;				// Multiple frames y correction
    	var HorCorrect=0;				// Multiple frames x correction
    	var LeftPaddng=3;				// Left padding
    	var TopPaddng=2;				// Top padding
    	var FirstLineHorizontal=1;			// SET TO 1 FOR HORIZONTAL MENU, 0 FOR VERTICAL
    	var MenuFramesVertical=1;			// Frames in cols or rows 1 or 0
    	var DissapearDelay=1000;			// delay before menu folds in
    	var TakeOverBgColor=1;			// Menu frame takes over background color subitem frame
    	var FirstLineFrame='navig';			// Frame where first level appears
    	var SecLineFrame='space';			// Frame where sub levels appear
    	var DocTargetFrame='space';			// Frame where target documents appear
    	var TargetLoc='';				// span id for relative positioning
    	var HideTop=0;				// Hide first level when loading new document 1 or 0
    	var MenuWrap=1;				// enables/ disables menu wrap 1 or 0
    	var RightToLeft=0;				// enables/ disables right to left unfold 1 or 0
    	var UnfoldsOnClick=0;			// Level 1 unfolds onclick/ onmouseover
    	var WebMasterCheck=0;			// menu tree checking on or off 1 or 0
    	var ShowArrow=1;				// Uses arrow gifs when 1
    	var KeepHilite=1;				// Keep selected path highligthed
    	var Arrws=['tri.gif',5,10,'tridown.gif',10,5,'trileft.gif',5,10];	// Arrow source, width and height
    
    function BeforeStart(){return}
    function AfterBuild(){return}
    function BeforeFirstOpen(){return}
    function AfterCloseAll(){return}
    
    
    Menu1=new Array("Home","http://a.it","",0,20,60);
    
    Menu2=new Array("Società","#","",7,20,80);
    	Menu2_1=new Array("A","blank.htm","",0,35,170);
    	Menu2_2=new Array("B","blank.htm","",0,35,170);
    	Menu2_3=new Array("C","blank.htm","",0,35,170);
    	Menu2_4=new Array("D","blank.htm","",0,35,170);
    	Menu2_5=new Array("E","blank.htm","",0,35,170);
    	Menu2_6=new Array("F","blank.htm","",0,35,170);
    	Menu2_7=new Array("G","blank.htm","",0,35,170);						
    
    Menu3=new Array("A","blank.htm","",5,20,80);
    	Menu3_1=new Array("A","blank.htm","",4,20,150);
    		Menu3_1_1=new Array("A","blank.htm","",0,20,150);
    		Menu3_1_2=new Array("B","blank.htm","",0,20,150);
    		Menu3_1_3=new Array("C","blank.htm","",0,20,150);
    		Menu3_1_4=new Array("D","blank.htm","",0,20,150);
    	Menu3_2=new Array("A","blank.htm","",2);
    		Menu3_2_1=new Array("A","blank.htm","",0,20,150	
    		Menu3_2_2=new Array("B","blank.htm","",0,20,150	
    	Menu3_3=new Array("C","blank.htm","",0);
    	Menu3_4=new Array("D","blank.htm","",0);
    	Menu3_5=new Array("E","blank.htm","",0);		
    
    Menu4=new Array("A","blank.htm","",3,20,78);
    	Menu4_1=new Array("A","blank.htm","",0,20,180);
    	Menu4_2=new Array("B","blank.htm","",0);
    	Menu4_3=new Array("C","blank.htm","",0);
    
    Menu5=new Array("A","javascript:top.location.href='blank.htm'","",2,20,98);
    	Menu5_1=new Array("A","blank.htm","",0,20,140);
    	Menu5_2=new Array("B","blank.htm","",0,20,140);	
    	
    Menu6=new Array("A","javascript:top.location.href='blank.htm'","",7,20,140);
    	Menu6_1=new Array("A","blank.htm","",0,20,140);
    	Menu6_2=new Array("A","blank.htm","",0,20,140);	
    	Menu6_3=new Array("B","blank.htm","",0,20,140);
    	Menu6_4=new Array("C","blank.htm","",0,20,140);	
    	Menu6_5=new Array("D","blank.htm","",0,20,140);
    	Menu6_6=new Array("E","blank.htm","",0,20,140);	
    	Menu6_7=new Array("F","blank.htm","",0,20,140);
    	
    Menu7=new Array("A","javascript:top.location.href='blank.htm'","",0,20,110);	
    Menu8=new Array("B","javascript:top.location.href='blank.htm'","",0,20,110);	
    Menu9=new Array("C","javascript:top.location.href='blank.htm'","",0,20,80);	
    Menu10=new Array("D","javascript:top.location.href='blank.htm'","",0,20,120);	
    	
    			
    </script>
    <script type='text/javascript' src='menu_com.js'></script>
    <noscript>Your browser does not support script</noscript>
    Questo sta nell'body mentre nel head c'è l'onresize che ho scritto sopra.

  6. #6
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    21,188
    Quello che hai postato e` il "database" di uno script che non hai incluso.

    Potrebbe stare dentro il file "menu_com.js" che dovrebbe essere nella stessa dir della pagina.

    Devi controllare che lo script non contenga altri onresize (nel tag <body> o nello script).
    Nuova politica di maggiore severita` sui titoli delle discussioni: (ri)leggete il regolamento
    No domande tecniche in messaggi privati

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.