Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    Problema con layer e scroll

    Ciao,
    creato una tabella con dentro un layer con lo scroll, il mio problema sta nel fatto che mentre carico la pagina si vede tutto il testo del layer (che ovviamente non si dovrebbe vedere...altrimenti lo scroll non servirebbe)...quando ha finito di caricare la pagina, tutto ok!
    E' possibile evitare questo problema?
    Vi posto un po' il codice...

    ------Questo è nell'HEAD-------------------

    <STYLE TYPE="text/css">
    <!--

    #example {
    position: absolute;
    width: 390px;
    padding: 10px;
    border: none;
    visibility: visible;
    top: 128px;
    z-index:1;
    overflow: hidden;



    }

    #example p { color: #ffffff;
    margin: 0px;}

    #example em {color: #FFFFFF}

    span.lighter {color: #ffffff;
    background: #FFFFFF;
    }

    -->
    </STYLE>
    <script language="JavaScript" type="text/JavaScript">
    <!--
    var clipTop = 0;
    var clipWidth = 390;
    var clipBottom = 169;
    var topper = 128;
    var lyrheight = 0;
    var time,amount,theTime,theHeight,DHTML;

    function prepLyr()
    {
    DHTML = (document.getElementById || document.all || document.layers)
    if (!DHTML) return;
    var x = new getObj('example');
    if (document.layers)
    {
    lyrheight = x.style.clip.bottom;
    lyrheight += 20;
    x.style.clip.top = clipTop;
    x.style.clip.left = 0;
    x.style.clip.right = clipWidth;
    x.style.clip.bottom = clipBottom;
    }
    else if (document.getElementById || document.all)
    {
    lyrheight = x.obj.offsetHeight;
    x.style.clip = 'rect('+clipTop+' '+clipWidth+' '+clipBottom+' 0)'
    }
    }

    function scrollayer(layername,amt,tim)
    {
    if (!DHTML) return;
    thelayer = new getObj(layername);
    if (!thelayer) return;
    amount = amt;
    theTime = tim;
    realscroll();
    }

    function stopScroll()
    {
    if (time) clearTimeout(time);
    }

    function realscroll()
    {
    if (!DHTML) return;
    clipTop += amount;
    clipBottom += amount;
    topper -= amount;
    if (clipTop < 0 || clipBottom > lyrheight)
    {
    clipTop -= amount;
    clipBottom -= amount;
    topper += amount;
    return;
    }
    if (document.getElementById || document.all)
    {
    clipstring = 'rect('+clipTop+' '+clipWidth+' '+clipBottom+' 0)'
    thelayer.style.clip = clipstring;
    thelayer.style.top = topper;
    }
    else if (document.layers)
    {
    thelayer.style.clip.top = clipTop;
    thelayer.style.clip.bottom = clipBottom;
    thelayer.style.top = topper;
    }
    time = setTimeout('realscroll()',theTime);
    }

    function vis(val)
    {
    if (!DHTML) return;
    var f = new getObj('example');
    f.style.visibility = val;
    }

    function getObj(name)
    {
    if (document.getElementById)
    {
    this.obj = document.getElementById(name);
    this.style = document.getElementById(name).style;
    }
    else if (document.all)
    {
    this.obj = document.all[name];
    this.style = document.all[name].style;
    }
    else if (document.layers)
    {
    this.obj = document.layers[name];
    this.style = document.layers[name];
    }
    }

    //-->
    </script>

    ------------ Fine HEAD -------------------
    <body onLoad="prepLyr()">
    ...
    <div id="example">
    testo lungo
    </div>

  2. #2
    devi chiamare lo script non sull' onLoad ma all'apertura del sito.

    Però dopo che che hai nominato il livello.

    In parole povere:

    subito dopo <div ...> </div>

    metti

    <script>
    prepLyr()
    </script>



  3. #3
    Ho provato...ma prima che si carichino tutte le immagini o comunque tutta la pagina, mi viene visualizzato il testo del layer!
    Sigh!

    Altri consigli?
    Alessandro

  4. #4
    Aiutatemi per favore...sto sclerandooooooo!!!



    Alessandro

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.