Visualizzazione dei risultati da 1 a 6 su 6
  1. #1
    Utente di HTML.it
    Registrato dal
    Oct 2002
    Messaggi
    25

    immagine o tabella ke segue lo scrolling

    chi sa darmi il codice per creare un immagine ke segue sempre la pgina rimanendo sempre al centro ...vedete esempio:
    http://www.tgmonline.it/

    grazie...

  2. #2
    tra gli <head>

    codice:
    <script LANGUAGE="JavaScript">
    function setVariables() {
    if (navigator.appName == "Netscape") {
    v = ".top=";
    h = ".left=";
    dS = "document.";
    sD = "";
    y = "window.pageYOffset";
    x = "window.pageXOffset";
    iW = "window.innerWidth";
    iH = "window.innerHeight";
    }
    
    else {
    h = ".pixelLeft=";
    v = ".pixelTop=";
    dS = "";
    sD = ".style";
    y = "document.body.scrollTop";
    x = "document.body.scrollLeft";
    iW = "document.body.clientWidth";
    iH = "document.body.clientHeight";
    }
    xyz = 500;
    innerX = eval(iW) - 200;
    innerY = eval(iH) - 350;
    object = "logo";
    checkLocationA();
    }
    movex = 0;
    movey = 0;
    xdiff = 0;
    ydiff = 0;
    ystart = 0;
    xstart = 0;
    
    function checkLocation() {
    yy = eval(y);
    xx = eval(x);
    ydiff = ystart - yy;
    xdiff = xstart - xx;
    if ((ydiff < (-1)) || (ydiff > (1))) movey = Math.round(ydiff / 10), ystart -= movey;
    if ((xdiff < (-1)) || (xdiff > (1))) movex = Math.round(xdiff / 10), xstart -= movex;
    eval(dS + object + sD + v + (ystart + innerY));
    eval(dS + object + sD + h + (xstart + innerX));
    setTimeout("checkLocation()", 10);
    }
    
    function checkLocationA() {
    ystart = eval(y);
    xstart=eval(x);
    }
    
    function switchLogo(abc) {
    if (abc == "menu") {
    eval(dS + object + sD + v + 0);
    eval(dS + object + sD + h + (-200));
    object = abc;
    }
    else xyz = setTimeout("delayLogo()", 2000)
    }
    
    function delayLogo() {
    eval(dS + object + sD + v + 0);
    eval(dS + object + sD + h + (-200));
    object = 'logo';
    }
    //  End -->
    </script>
    e nel body

    codice:
    <body OnLoad="setVariables();checkLocation()" bgcolor="#00FFFF">
    <div id="logo" style="position:absolute; visibility:show; left:0px; top:-200px; z-index:2">
    
    <table border="0" cellspacing="10" cellpadding="0" width="100">
      <tr>
        <td><p align="center">[img]logo.gif[/img]</td>
      </tr>
    </table>
    </div>

  3. #3
    Utente di HTML.it
    Registrato dal
    Feb 2003
    Messaggi
    411
    display: fixed;
    naturalmente dopo dovrai dire a tutti i visitatori del tuo sito di non usare explorer, ma questa è una questione secondaria :gren:

  4. #4
    Utente di HTML.it
    Registrato dal
    Oct 2002
    Messaggi
    25
    e se dovessi usare una tabella al posto dell'imagine???

  5. #5
    Utente di HTML.it
    Registrato dal
    Oct 2002
    Messaggi
    25
    e se dovessi usare una tabella al posto dell'imagine???

  6. #6
    Utente di HTML.it
    Registrato dal
    Oct 2002
    Messaggi
    25
    mi serve x questa tabella:


    <table width="62" border="1" cellspacing="0" cellpadding="0">
    <tr>
    <td width="58"><div align="center">a</div></td>
    </tr>
    <tr>
    <td><div align="center">b</div></td>
    </tr>
    <tr>
    <td><div align="center">c</div></td>
    </tr>
    <tr>
    <td><div align="center">d</div></td>
    </tr>
    <tr>
    <td><div align="center">e</div></td>
    </tr>
    <tr>
    <td><div align="center">f</div></td>
    </tr>
    <tr>
    <td><div align="center">g</div></td>
    </tr>
    </table>

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.