<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Caricare una parte di sito subito e l'altra quando quest'ultima ha terminato..]]></title><description><![CDATA[<p dir="auto">Ciao ragazzi ho un problema, sto realizzando un sito web che ha un menu fatto in flash un po' pesantuccio con un preload annesso..<br />
Sotto a questo ho lasciato uno spazio per le news flash..che vengono caricate da DB e visualizzate come testo scorrevole da destra a sinistra tramite un javascript..</p>
<p dir="auto">Cosa accade?Quando carico la pagina a cache vuota,  mentre mi esegue il preload del menu in flash, nel riquadro lasciato per le news mi vengono visualizzati i contenuti di quest'ultime una sotto l'altra tutte "appiccicate" fra loro..insomma una gran ciofeca.. <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/1f62e.png?v=2190ae3dadd" class="not-responsive emoji emoji-android emoji--open_mouth" style="height:1.4em;width:auto;vertical-align:middle" title=":o" alt="😮" /><br />
E poi quando il preload è terminato, e il menu è caricato correttamente, le news vengono visualizzate correttamente nel loro riquadro..</p>
<p dir="auto">Quindi mi chiedevo se era possibile, tramite un javascript, di poter visualizzare le news solo quando il menu si era scaricato correttamente..visto che l'errore/orrore è solo li..<br />
E' realizzabile una cosa del genere secondo voi?</p>
<p dir="auto">Il javascript per il testo scorrevole che sto utilizzando è questo:</p>
<pre><code class="language-html">&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;&lt;/title&gt;
&lt;script type="text/javascript"&gt;
Retain this message and you may use the code freely.

var speed=50        // speed of scroller
var step=3          // smoothness of movement
var top="#top"      // name of anchor used as page top when clicking start / stop / show
var Start= "Start"  // Text for start link
var Stop = "Stop"   // Text for stop link
var Show = "Show"   // Text for show link

var x, scroll, divW, sText=""

function onclickIE(idAttr,handler,call){
  if ((document.all)&amp;&amp;(document.getElementById)){idAttr[handler]=new Function(call)}
}

function addLink(id,call,txt){
  var e=document.createElement('A')
  e.setAttribute('href',top)
  e.setAttribute('onclick',call)
  var linktext=document.createTextNode(txt)
  e.appendChild(linktext)
  document.getElementById(id).appendChild(e)
}

function addControls(){
  addLink('controls','clickAction(0)',Stop)
  onclickIE(document.getElementById('controls').childNodes[0],"onclick",'clickAction(0)')
  document.getElementById('controls').appendChild(document.createTextNode(' | '))
  addLink('controls','clickAction(2)',Show)
  onclickIE(document.getElementById('controls').childNodes[2],"onclick",'clickAction(2)')
}

function stopScroller(){clearTimeout(scroll)}

function setAction(node,callvalue,txt){
  var c=document.getElementById('controls')
  c.childNodes[node].setAttribute('onclick','clickAction('+callvalue+')')
  onclickIE(document.getElementById('controls').childNodes[node],"onclick",'clickAction('+callvalue+')')
  c.childNodes[node].firstChild.nodeValue=txt
}

function clickAction(no){
  switch(no) {
    case 0:
      stopScroller()
      setAction(0,1,Start)
      setAction(2,2,Show)
      break
    case 1:
      startScroller()
      setAction(0,0,Stop)
      setAction(2,2,Show)
      break
    case 2:
      stopScroller()
      setAction(0,1,Start)
      setAction(2,3,Start)
      x=0
      document.getElementById('tag').style.whiteSpace='normal'
      document.getElementById('tag').style.left='0px'
      break
    case 3:
      startScroller()
      setAction(0,0,Stop)
      setAction(2,2,Show)
      x=divW
      document.getElementById('tag').style.left=x+'px'
  }
}

function startScroller(){
  document.getElementById('tag').style.whiteSpace='nowrap'
  var p=document.createElement('P')
  p.id='testP'
  p.style.fontSize='25%' //fix for mozilla. multiply by 4 before using
  x-=step
  if (document.getElementById('tag').className) p.className=document.getElementById('tag').className
  p.appendChild(document.createTextNode(sText))
  document.body.appendChild(p)
  pw=p.offsetWidth
  document.body.removeChild(p)
  if (x&lt;(pw*4)*-1){x=divW}
  document.getElementById('tag').style.left=x+'px'
  scroll=setTimeout('startScroller()',speed)
}

function initScroller(){
  if (document.getElementById &amp;&amp; document.createElement &amp;&amp; document.body.appendChild) {
    addControls()
    document.getElementById('controls').style.display='block'
    divW=document.getElementById('scroller').offsetWidth
    x=divW
    document.getElementById('tag').style.position='relative'
    document.getElementById('tag').style.left=divW+'px'
    var ss=document.getElementById('tag').childNodes
    for (i=0;i&lt;ss.length;i++) {sText+=ss[i].nodeValue+" "}
    scroll=setTimeout('startScroller()',speed)
  }
}

function addLoadEvent(func) {
  if (!document.getElementById | !document.getElementsByTagName) return
  var oldonload = window.onload
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload()
      func()
    }
  }
}

addLoadEvent(initScroller)
&lt;/script&gt;
  &lt;style type="text/css" media="screen"&gt;
body {font:80%/150% verdana,sans-serif; color:#006; margin:0}
h1 {font:200% georgia,serif; color:#009; margin-top:20px}


/* position:relative and overflow:hidden are required */
#scroller {position:relative; overflow:hidden; width:100%; border:1px solid #657}

/* display:none prevents the controls being shown when JavaScript is not present */
#controls {display:none; text-align:right}

/* add link formatting for the controls */
#controls a {}

/* add formatting for the scrolling text */
#tag {margin:2px 0}

/* #testP must also contain all text-sizing properties of #tag */
#testP {visibility:hidden; position:absolute; white-space:nowrap;}

/* used as a page top marker and to limit width */
#top {width:350px; margin:auto}    
    
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h2&gt;Text Scroller accessibile&lt;/h2&gt;
&lt;div id="scroller"&gt;
&lt;p id="tag"&gt;Ciao io sono il messaggio. usa i link a destra per osservarmi meglio. Ciao!!&lt;/p&gt;
&lt;/div&gt;
    &lt;p id="controls"&gt;&lt;/p&gt;

&lt;/BODY&gt;
&lt;/HTML&gt;
</code></pre>
<p dir="auto">Attendo news..grazie a tutti!<img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/customizations/8d7b9529-9868-4606-8ca1-85ca7d28c845-wink.gif?v=2190ae3dadd" class="not-responsive emoji emoji-customizations emoji--wink3" style="height:1.4em;width:auto;vertical-align:middle" title=":wink3:" alt="" /></p>
]]></description><link>https://dev.connect.gt/topic/90312/caricare-una-parte-di-sito-subito-e-l-altra-quando-quest-ultima-ha-terminato</link><generator>RSS for Node</generator><lastBuildDate>Sat, 28 Nov 2026 07:09:35 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/90312.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 17 Dec 2008 11:14:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Caricare una parte di sito subito e l'altra quando quest'ultima ha terminato.. on Wed, 07 Jan 2009 20:57:24 GMT]]></title><description><![CDATA[<p dir="auto">Potresti nascondere il div che contiene le news, e farlo apparire quando è tutto caricato...</p>
]]></description><link>https://dev.connect.gt/post/792815</link><guid isPermaLink="true">https://dev.connect.gt/post/792815</guid><dc:creator><![CDATA[digital.daigor]]></dc:creator><pubDate>Wed, 07 Jan 2009 20:57:24 GMT</pubDate></item><item><title><![CDATA[Reply to Caricare una parte di sito subito e l'altra quando quest'ultima ha terminato.. on Wed, 17 Dec 2008 15:47:07 GMT]]></title><description><![CDATA[<p dir="auto">Altra domanda e se facessi in modo, magari con wait o sleep o loop che aspetti a caricare questo script?o ancor meglio il &lt;div id="news"&gt;..&lt;/div&gt; che identifica le news..non dovrei riuscire a risolvere?</p>
<p dir="auto">Ho provato anche con il marquee, ma uno non è W3C standard e due in firefox si vede in un modo e in ie7 si vede in un'altro..</p>
<p dir="auto">Ragazzi qualche aiuto?</p>
]]></description><link>https://dev.connect.gt/post/792816</link><guid isPermaLink="true">https://dev.connect.gt/post/792816</guid><dc:creator><![CDATA[ale1kids]]></dc:creator><pubDate>Wed, 17 Dec 2008 15:47:07 GMT</pubDate></item></channel></rss>