Bonjour à tous!
Je voudrais votre avis car j'ai créé un bandeau déroulant à excès de vitesse!
en fait le script de base de mioplanet marche très bien.
sauf quand on modifie le contenu qui défile en couplant à de l'ajax visiblement...
voici mon webticker modif:Concrètement à chaque mise à jour du bandeau: la vitesse de défilement accélère... et je ne parviens pas à savoir pourquoi ...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63 // WebTicker by Mioplanet // www.mioplanet.com TICKER_CONTENT = $('TICKER').innerHTML; TICKER_RIGHTTOLEFT = false; TICKER_SPEED = 2; TICKER_STYLE = "font-family:Arial; font-size:12px; color:#444444"; TICKER_PAUSED = false; ticker_start(); function ticker_start() { window.setTimeout("calcul2()",10000); var tickerSupported = false; TICKER_WIDTH = $('TICKER').style.width; var img = "<img src=ticker_space.gif width="+TICKER_WIDTH+" height=0>"; // Firefox if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("Safari")!=-1) { $('TICKER').innerHTML = "<TABLE cellspacing='0' cellpadding='0' width='100%'><TR><TD nowrap='nowrap'>"+img+"<SPAN style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'> </SPAN>"+img+"</TD></TR></TABLE>"; tickerSupported = true; } // IE if (navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1) { $('TICKER').innerHTML = "<DIV nowrap='nowrap' style='width:100%;'>"+img+"<SPAN style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'></SPAN>"+img+"</DIV>"; tickerSupported = true; } if(!tickerSupported) $('TICKER').outerHTML = ""; else { $('TICKER').scrollLeft = TICKER_RIGHTTOLEFT ? $('TICKER').scrollWidth - $('TICKER').offsetWidth : 0; document.getElementById("TICKER_BODY").innerHTML = TICKER_CONTENT; $('TICKER').style.display="block"; TICKER_tick(); } } function TICKER_tick() { if(!TICKER_PAUSED) $('TICKER').scrollLeft += TICKER_SPEED * (TICKER_RIGHTTOLEFT ? -1 : 1); if(TICKER_RIGHTTOLEFT && $('TICKER').scrollLeft <= 0) $('TICKER').scrollLeft = $('TICKER').scrollWidth - $('TICKER').offsetWidth; if(!TICKER_RIGHTTOLEFT && $('TICKER').scrollLeft >= $('TICKER').scrollWidth - $('TICKER').offsetWidth) $('TICKER').scrollLeft = 0; window.setTimeout("TICKER_tick()", 30); } function calcul2() { $('calculatrice2').request({ onComplete: function(transport) { var err2=""; err2 =(transport.responseText); if (err2!="") { ticker_maj(err2); } } }) } function ticker_maj(cont){ var plop=cont; TICKER_WIDTH = $('TICKER').style.width; TICKER_CONTENT=plop; TICKER_SPEED = 2; ticker_start(); }
Partager