Pagina 1 di 3 1 2 3 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 25

Discussione: problema js esterno

  1. #1

    problema js esterno

    In una pagina ho un menu (di quelli scaricati in rete) fatto in js che viene richiamato con un semplice

    <SCRIPT SRC="menu/menubase.js">
    </script>

    il menu funziona alla perfezione ma mi da un problemino sulla pagina: mi lascia un spazio enorme (come fossero 20
    ) alla fine della pagina facendo comparire la scrollbar inutilmente...

    Dite che il problema sta in qualche errore dentro il js oppure c'è qualche errore nel richiamo o nella pagina..?

    A voi vi è mai capitato qualcosa di simile? Sapete consigliarmi come risolvere?

    grazie
    Se per ogni sbaglio avessi 1000 Lire che vecchiaia che passerei! [Non è tempo per noi - Ligabue]
    Strade?! Dove andiamo noi non ci servono.....strade!

  2. #2
    Utente di HTML.it L'avatar di Dr Mal
    Registrato dal
    Apr 2002
    Messaggi
    2,536

    Re: problema js esterno

    Originariamente inviato da Saturno83
    In una pagina ho un menu (di quelli scaricati in rete) fatto in js che viene richiamato con un semplice

    <SCRIPT SRC="menu/menubase.js">
    </script>

    il menu funziona alla perfezione ma mi da un problemino sulla pagina: mi lascia un spazio enorme (come fossero 20
    ) alla fine della pagina facendo comparire la scrollbar inutilmente...

    Dite che il problema sta in qualche errore dentro il js oppure c'è qualche errore nel richiamo o nella pagina..?

    A voi vi è mai capitato qualcosa di simile? Sapete consigliarmi come risolvere?

    grazie
    Hai provato a vedere se nn hai degli spazi a fondo pagina?
    Il menu è stato fatto in fireworks x caso?
    [Proteggiamo la Natura e gli Animali: appartengono alle cose più belle che ci sono state donate.]

  3. #3

    Re: Re: problema js esterno

    Originariamente inviato da Dr Mal
    Hai provato a vedere se nn hai degli spazi a fondo pagina?
    Il menu è stato fatto in fireworks x caso?

    Certo ma di spazi non ne ho... tra l'altro con questo difetto non crea ne
    ne

    ma fa solamente dello spazio ingiustificato...


    Il menu lo scaricato... non saprei dirti con cosa è stato fatto... quello che ti posso dire è che c'è solo un file .js scritto naturalmente in javascript basato su degli array...
    Se per ogni sbaglio avessi 1000 Lire che vecchiaia che passerei! [Non è tempo per noi - Ligabue]
    Strade?! Dove andiamo noi non ci servono.....strade!

  4. #4
    Utente di HTML.it L'avatar di Dr Mal
    Registrato dal
    Apr 2002
    Messaggi
    2,536

    Re: Re: Re: problema js esterno

    Originariamente inviato da Saturno83
    Certo ma di spazi non ne ho... tra l'altro con questo difetto non crea ne
    ne

    ma fa solamente dello spazio ingiustificato...


    Il menu lo scaricato... non saprei dirti con cosa è stato fatto... quello che ti posso dire è che c'è solo un file .js scritto naturalmente in javascript basato su degli array...
    SE nn do' un okkiata al codice, nn posso aiutarti....
    [Proteggiamo la Natura e gli Animali: appartengono alle cose più belle che ci sono state donate.]

  5. #5
    è un po' lunghino...

    codice:
    // Syntaxes: *** START EDITING HERE, READ THIS SECTION CAREFULLY! ***
    //
    // menu[menuNumber][0] = new Menu(Vertical menu? (true/false), 'popout indicator', left, top,
    // width, 'mouseover colour', 'background colour', 'border stylesheet', 'text stylesheet');
    //
    // Left and Top are measured on-the-fly relative to the top-left corner of its trigger, or
    // for the root menu, the top-left corner of the page.
    //
    // menu[menuNumber][itemNumber] = new Item('Text', 'URL', 'target frame', length of menu item,
    //  additional spacing to next menu item, number of target menu to popout);
    //
    // If no target menu (popout) is desired, set it to 0. Likewise, if your site does not use
    // frames, pass an empty string as a frame target.
    //
    // Something that needs explaining - the Vertical Menu setup. You can see most menus below
    // are 'true', that is they are vertical, except for the first root menu. The 'length' and
    // 'width' of an item depends on its orientation -- length is how long the item runs for in
    // the direction of the menu, and width is the lateral dimension of the menu. Just look at
    // the examples and tweak the numbers, they'll make sense eventually :).
    
    var menu = new Array();
    
    // Default colours passed to most menu constructors (just passed to functions, not
    // a global variable - makes things easier to change later in bulk).
    var defOver = '#0099FF', defBack = '#0D08A8';
    
    // Default 'length' of menu items - item height if menu is vertical, width if horizontal.
    // DIMENSIONE ALTEZZA CELLA SOTTOMENU
    //var defLength = 22;
    var defLength = 17;
    
    
    // Menu 0 is the special, 'root' menu from which everything else arises.
    menu[0] = new Array();
    // A non-vertical menu with a few different colours and no popout indicator, as an example.
    // *** MOVE ROOT MENU AROUND HERE ***  it's positioned at (5, 0) and is 17px high now.
    
    w= ((document.body.clientWidth) / 2) - 376
    
    
    menu[0][0] = new Menu(false, '', w, 72, 0, '#0099FF', '#009EEF', '', 'itemText');
    // Notice how the targets are all set to nonzero values...
    // The 'length' of each of these items is 40, and there is spacing of 10 to the next item.
    // Most of the links are set to '#' hashes, make sure you change them to actual files.
    menu[0][1] = new Item('  Amministrazione', '../../../../giunta.htm', '', 109, 0, 1);
    menu[0][2] = new Item('  Uffici Comunali', '../../../../uffici.htm', '', 100, 0, 2);
    menu[0][3] = new Item('  Istruzione', '../../../../istruzione.htm', '', 68, 0, 3);
    menu[0][4] = new Item('  Territorio', '../../../../territorio.htm', '', 65, 0,0);
    menu[0][5] = new Item('  Turismo', '../../../../Turismo/infotur.htm', '', 53, 5, 5);
    menu[0][6] = new Item('  Eventi', '../../../../eventi.htm', '', 43, 5, 0);
    menu[0][7] = new Item('  Storia', '../../../../storia.htm', '',49,0,0);
    menu[0][8] = new Item('  Cultura', '../../../../cultura.htm', '', 54, 0, 0);
    menu[0][9] = new Item('  Chiese', '../../../../culto.htm', '', 52, 0, 0);
    menu[0][10] = new Item('  Associazioni', '../../../../associazioni.htm', '', 78, 5, 0);
    menu[0][11] = new Item('  Gemellaggi', '../../../../gemellaggi.htm', '', 70, 5, 0);
    
    
    // File menu.
    menu[1] = new Array();
    // The File menu is positioned 0px across and 22 down from its trigger, and is 80 wide.
    // All text in this menu has the stylesheet class 'item' -- see the <style> section above.
    // We've passed a 'greater-than' sign '>' as a popout indicator. Try an image...?
    
    // MENU AMMINISTRAZIONE
    menu[1] = new Array();
    menu[1][0] = new Menu(true, '>', 0, 22, 115, defOver, defBack, 'itemBorder', 'itemText');
    menu[1][1] = new Item('Saluto del Sindaco', '../../../../saluto.htm', '', defLength, 0, 0);
    //menu[1][2] = new Item('Paste', '#', '', defLength, 0, 0);
    //menu[1][3] = new Item('Paste', '#', '', defLength, 0, 0);
    
    
    // MENU UFFICI COMUNALI
    menu[2] = new Array();
    menu[2][0] = new Menu(true, '>', 0, 22, 165, defOver, defBack, 'itemBorder', 'itemText');
    menu[2][1] = new Item('Centralino', '../../../../uffici.htm#centralino', '', defLength, 0, 0);
    menu[2][2] = new Item('Sindaco', '../../../../uffici.htm#sindaco', '', defLength, 0, 0);
    menu[2][3] = new Item('Segretario Generale', '../../../../uffici.htm#segretario', '', defLength, 0, 0);
    menu[2][4] = new Item('Vice Segretario', '../../../../uffici.htm#vicesegret', '', defLength, 0, 0);
    menu[2][5] = new Item('Seg. Generale e protolocco', '../../../../uffici.htm#sgenerale', '', defLength, 0, 0);
    menu[2][6] = new Item('Messo Comunale', '../../../../uffici.htm#messo', '', defLength, 0, 0);
    menu[2][7] = new Item('Appalti', '../../../../uffici.htm#appalti', '', defLength, 0, 0);
    menu[2][8] = new Item('Ragioneria', '../../../../uffici/ragioneria.htm', '', defLength, 0, 0);
    menu[2][9] = new Item('Tributi', '../../../../uffici/ragioneria.htm', '', defLength, 0, 0);
    menu[2][10] = new Item('Socio Scolastico', '../../../../uffici/scolastico.htm', '', defLength, 0, 0);
    menu[2][11] = new Item('Tecnico', '#', '', defLength, 0, 8);
    menu[2][12] = new Item('Demografici', '../../../../uffici.htm#demografico', '', defLength, 0, 0);
    menu[2][13] = new Item('Sport e Turismo', '../../../../uffici/turismo_sport.htm', '', defLength, 0, 0);
    menu[2][14] = new Item('Ecologia Ambiente e Casa', '../../../../uffici/ecologia.htm', '', defLength, 0, 0);
    menu[2][15] = new Item('Commercio-Attività produttive-Polizie Amm.va', '../../../../uffici/poliz_amm.htm', '', defLength, 0, 0);
    menu[2][16] = new Item('Polizia Amministrativa', '../../../../uffici/poliz_amm.htm', '', defLength, 0, 0);
    menu[2][17] = new Item('Polizia Municipale', '../../../../uffici.htm#pmunicipale', '', defLength, 0, 0);
    menu[2][18] = new Item('Sala Consigliare', '../../../../uffici.htm#sala', '', defLength, 0, 0);
    menu[2][19] = new Item('Centro Sociale', '../../../../uffici.htm#centro', '', defLength, 0, 0);
    menu[2][20] = new Item('Magazzino Comunale', '../../../../uffici.htm#magazzino', '', defLength, 0, 0);
    menu[2][21] = new Item('Emergenza acquedotto', '../../../../uffici.htm#acquedotto', '', defLength, 0, 0);
    //menu[2][3] = new Item('Paste', '#', '', defLength, 0, 0);
    
    // ISTRUZIONE
    menu[3] = new Array();
    menu[3][0] = new Menu(true, '>', 0, 22, 145, defOver, defBack, 'itemBorder', 'itemText');
    menu[3][1] = new Item('SCUOLE MATERNE', '../../../../istruzione.htm#materne', '', defLength, 0, 9);
    menu[3][2] = new Item('SCUOLE ELEMENTARI', '../../../../istruzione.htm#elementari', '', defLength, 0, 0);
    menu[3][3] = new Item('SCUOLE MEDIE', '../../../../istruzione.htm#medie', '', defLength, 0, 0);
    menu[3][4] = new Item('SCUOLE PROFESSIONALI', '../../../../istruzione.htm#professionali', '', defLength, 0, 0);
    menu[3][5] = new Item('ISTITUTI TECNICI', '../../../../istruzione.htm#tecnici', '', defLength, 0, 0);
    menu[3][6] = new Item('NEWS...', '../../../../istruzione01.htm', '', defLength, 0, 0);
    
    // EVENTI E MANIFESTAZIONI
    menu[4] = new Array();
    menu[4][0] = new Menu(true, '>', 0, 22, 110, defOver, defBack, 'itemBorder', 'itemText');
    menu[4][1] = new Item('MANIFESTAZIONI', '../../../../eventi.htm', '', defLength, 0, 0);
    
    
    
    // TURISMO
    menu[5] = new Array();
    menu[5][0] = new Menu(true, '>', 0, 22, 110, defOver, defBack, 'itemBorder', 'itemText');
    menu[5][1] = new Item('MANIFESTAZIONI', '../../../../manifestazioni01.htm', '', defLength, 0, 0);
    menu[5][2] = new Item('COSA VEDERE...', '../../../../Turismo/luoghi.htm', '', defLength, 0, 0);
    menu[5][3] = new Item('ITINERARI', '#', '', defLength, 0, 6);
    menu[5][4] = new Item('PARCHI', '../../../../parchi.htm', '', defLength, 0, 0);
    menu[5][5] = new Item('AGRITURISMO', '#', '', defLength, 0, 0);
    menu[5][6] = new Item('ARTIGIANATO', '#', '', defLength, 0, 0);
    menu[5][7] = new Item('CUCINA TIPICA', '../../../../cucina.htm', '', defLength, 0, 0);
    menu[5][8] = new Item('LAGHI A GIAVENO', '../../../../laghi.htm', '', defLength, 0, 0);
    
    
    
    // SOTTOMENU TURISMO
    menu[6] = new Array();
    menu[6][0] = new Menu(true, '>', 110, 0, 100, defOver, defBack, 'itemBorder', 'itemText');
    menu[6][1] = new Item('- IN AUTO', '#', '', defLength, 0, 0);
    menu[6][2] = new Item('- IN BICICLETTA', '../../../../itin_bici.htm', '', defLength, 0, 0);
    menu[6][3] = new Item('- A PIEDI', '../../../../itin_piedi.htm', '', defLength, 0, 0);
    menu[6][4] = new Item('- A CAVALLO', '../../../../itin_cavallo.htm', '', defLength, 0, 0);
    
    
    // MENU CULTURA
    menu[7] = new Array();
    menu[7][0] = new Menu(true, '>', 0, 22, 65, defOver, defBack, 'itemBorder', 'itemText');
    
    
    // UFFFICI TECNICI
    menu[8] = new Array();
    menu[8][0] = new Menu(true, '>', 166, 0, 180, defOver, defBack, 'itemBorder', 'itemText');
    menu[8][1] = new Item('- Urbanistica ed Edilizia privata', '../../../../uffici/Urbanistica.htm', '', defLength, 0, 0);
    menu[8][2] = new Item('- Lavori Pubblici', '../../../../uffici/lav_pubblici.htm', '', defLength, 0, 0);
    
    
    // SOTTOMENU Istruzione
    menu[9] = new Array();
    menu[9][0] = new Menu(true, '>', 145, 0, 102, defOver, defBack, 'itemBorder', 'itemText');
    menu[9][1] = new Item('- AVVISI', '../../../../avvisiscuole.htm', '', defLength, 0, 0);
    Se per ogni sbaglio avessi 1000 Lire che vecchiaia che passerei! [Non è tempo per noi - Ligabue]
    Strade?! Dove andiamo noi non ci servono.....strade!

  6. #6
    Utente di HTML.it L'avatar di Dr Mal
    Registrato dal
    Apr 2002
    Messaggi
    2,536
    Mi dai anke il codice della pagina?
    [Proteggiamo la Natura e gli Animali: appartengono alle cose più belle che ci sono state donate.]

  7. #7
    codice:
    <html>
    
    <head>
    
    <title>Sito prova</title>
    
    
    <script language="JavaScript1.2">
    function reapply(){
    setTimeout("slideit()",2000)
    return true
    }
    window.onerror=reapply
    </script>
    <script language="JavaScript1.1">
    <!--
    var image1=new Image()
    image1.src="images/slide5.jpg"
    var image2=new Image()
    image2.src="images/slide2.jpg"
    var image3=new Image()
    image3.src="images/slide3.jpg"
    var image4=new Image()
    image4.src="images/slide4.jpg"
    var image5=new Image()
    image5.src="images/slide1.jpg"
    //-->
    </script>
    
    
    <SCRIPT SRC="menu/code.js">
    </script>
    
    <link rel="stylesheet" type="text/css" href="menu/menu.CSS">
    
    <style>
    .lnk {width: 100; color:white; font-family:verdana; font-size:8pt; text-decoration:none; font-weight:bold; font-align:center;}
    .lnk:hover {width:100; BACKGROUND: darkblue;HEIGHT:15}
    .htb {background:#000080; color: #FFFFFF; border-bottom: 2px solid #FFC608; border-right: 1px solid #FFB200; font: bold italic 10pt verdana; color: #FFFFFF; text-align: center; border-top: 1px solid #FFB200; border-left: 1px solid #FFB200;}
    .btb A {background:#009DE0; text-align: center; border-bottom: 2px solid #000080; border-right: 2px solid #000080; font: bold 9pt verdana; color: #000080; position:relative; display: block; text-decoration:none;}
    .btb A:hover {background:#FFC608; text-align: center; border-bottom: 2px solid #000080; border-right: 2px solid #000080; font: bold 9pt verdana; color: #000080; display: block; position:relative;}
    </style>
    
    </head>
    
    <body topmargin="0" leftmargin="0" onLoad="writeMenus(); slideit()" onResize="if (isNS4) nsResizeHandler(); self.location.reload()" background="images/sfondino.jpg">
    <center>
    <table border="0" width="765" cellspacing="0" cellpadding="0" height="99" style="border-left: 2 solid #000080; border-right: 2 solid #000080">
    <tr>
    <td background="images/testata.gif" height="99">
    <SCRIPT SRC="menu/menubase2.js">
    </script>
    </td>
    </tr>
    </table>
      <table border="0" cellpadding="0" cellspacing="0" width="765" height="430" style="border-left: 2 solid #000080; border-right: 2 solid #000080; border-bottom: 2 solid #000080">
        <tr>
          <td width="153" height="25"></td>
        <td width="453" height="409" rowspan="2" valign="top">
    <p align="center">
    [img]images/head_giaveno.jpg[/img]
          
    
    <CENTER>
    [img]images/slide1.jpg[/img]
    <script>
    <!--
    ////change number of images below 
    var number_of_images=5
    //change speed below (in seconds)
    var speed=3
    var step=1
    var whichimage=1
    function slideit(){
    if (!document.images)
    return
    if (document.all)
    slide.filters.blendTrans.apply()
    document.images.slide.src=eval("image"+step+".src")
    if (document.all)
    slide.filters.blendTrans.play()
    whichimage=step
    if (step<number_of_images)
    step++
    else
    step=1
    if (document.all)
    setTimeout("slideit()",speed*1000+3000)
    else
    setTimeout("slideit()",speed*1000)
    }
    function slidelink(){
    if (whichimage==1)
    window.location="http://www.giaveno.it"
    else if (whichimage==2)
    window.location="http://www.prova.it"
    else if (whichimage==3)
    window.location="http://www.prova.it"
    else if (whichimage==4)
    window.location="http://www.prova.it"
    else if (whichimage==5)
    window.location="http://www.prova.it"
    }
    //-->
    </script>
    
    </CENTER>
        
    
     
    <div align="center">
      <center> 
            <table border="0" width="80%" height="41">
              <tr>
                <td width="100%" height="20" valign="top" style="border: 2px solid #009DEB">
                  <p align="center"><font face="Verdana" color="#000080" size="2">EVENTI
                  E NEWS</font></p>
                </td>
              </tr>
              <tr>
                <td width=200 bgcolor="#FFFFFF" height="21" valign="top" style="border: 2px solid #000080">
    <p align="center">
    <iframe src="scroller2.htm" width=350 height=100 frameborder=no scrolling=no>
    </iframe>
                 
                </td>
              </tr>
            </table>
      </center>
    </div>
            
            
            
          </td>
        <td width="149" valign=top height="25">
        </td>
        </tr>
        <tr>
          <td width="153" valign="top" height="384">
           <center>
              <div align="center">
                <center>
              <table border="0" width="90%" cellpadding="0">
                <tr>
                  <td class='htb' align="center">Giaveno.it</td>
                </tr>
                <tr>
                  <td class='btb' align="center">Eventi</td>
                </tr>
                <tr>
                  <td class='btb' align="center">Appalti</td>
                </tr>
                <tr>
                  <td class='btb' align="center">Turismo</td>
                </tr>
                <tr>
                  <td class='btb' align="center">Istruzione</td>
                </tr>
                <tr>
                  <td class='btb' align="center">Territorio</td>
                </tr>            
                <tr>
                  <td class='btb' align="center">Amministrazione</td>
                </tr>                        
                <tr>
                  <td class='btb' align="center">Uffici comunali</td>
                </tr>                                        
              </table>
                </center>
              </div>
            <p align="center"></p>
            <p align="center">[img]images/Appalti.gif[/img]</p>
            <p align="center"></p>
            <p align="center"></p>
            <p align="center">[img]images/eventi02.gif[/img]</p>
            <p align="center"></p>
            <p align="center" style="word-spacing: 0; margin: 0">
            <p align="center">
            <p align="center" style="word-spacing: 0; margin: 0"><font size="1"></font>
            <p align="center" style="word-spacing: 0; margin: 0"><font size="1"></font>
            <p align="center" style="word-spacing: 0; margin: 0"></center></td>
        </center>
        <center>
        <td width="149" valign=top height="384">
          <p align="center">[img]images/regione.gif[/img]</p>
          <p align="center"></p>
          <p align="center">[img]images/provinciaTO.gif[/img]</p>
          <p align="center"></p>
          <p align="center">[img]images/torino2006.gif[/img]</p>
          <p align="center"></p>
          <p align="center">[img]images/info.gif[/img]
          </p>
        </td>
        </tr>
        <tr>
          <td height="21" colspan="3" valign="top" width="759">
            <p align="center" style="word-spacing: 0; margin: 0"><font face="Tahoma" color="#000080" size="1"></font></td>
        </tr>
      </table>
    </body>
    </html>
    Se per ogni sbaglio avessi 1000 Lire che vecchiaia che passerei! [Non è tempo per noi - Ligabue]
    Strade?! Dove andiamo noi non ci servono.....strade!

  8. #8
    Utente di HTML.it L'avatar di Dr Mal
    Registrato dal
    Apr 2002
    Messaggi
    2,536
    Attendi, sto dando un'okkiata....
    X semplificari la vita, hai per caso un link di riferimento?
    Un'altra cosa: nel codice, il menu' in questione con ke nome lo rikiami?
    [Proteggiamo la Natura e gli Animali: appartengono alle cose più belle che ci sono state donate.]

  9. #9
    Utente di HTML.it L'avatar di Dr Mal
    Registrato dal
    Apr 2002
    Messaggi
    2,536
    Allora: ho controllato la pagina il codice e...... va tutto bene!
    Gli spazi nn esistono, visualizzo tutto x bene,
    [Proteggiamo la Natura e gli Animali: appartengono alle cose più belle che ci sono state donate.]

  10. #10
    Originariamente inviato da Dr Mal
    Attendi, sto dando un'okkiata....
    X semplificari la vita, hai per caso un link di riferimento?
    Un'altra cosa: nel codice, il menu' in questione con ke nome lo rikiami?
    il link: clikka qui

    il richiamo lo faccio così:

    <SCRIPT SRC="menu/menubase.js">
    </script>
    Se per ogni sbaglio avessi 1000 Lire che vecchiaia che passerei! [Non è tempo per noi - Ligabue]
    Strade?! Dove andiamo noi non ci servono.....strade!

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.