Bonjour,
sur une de mes pages j'ai des messages qui doivent défiler et je dois les convertir en XHTML. Mais je sais pas trop comment faire.
Voici le code :
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
var scrollerwidth=220
var scrollerheight=60
var scrollerbgcolor='white'
//configurer les variables suivantes pour le contenu de vos messages.
var messages=new Array()
messages[0]="<p class=texte style='text-align: left;FONT-SIZE: 10pt; font-weight: bold;'><a href=oral.php onclick=\"javascript:window.open(this.href,'popup','resizable=0,height=690,width=550');return false;\" class=texte style='FONT-SIZE: 10pt; font-weight: bold;text-align: left;'><font color=#CC0000 style='text-align: left;FONT-SIZE: 10pt; font-weight: bold;'><b>Préparation intensive à l'oral<\/b><\/font><\/a><\/p><p class=texte style='FONT-SIZE: 3pt;'>&nbsp;<\/p><p class=texte style='text-align: left;FONT-SIZE: 10pt; font-weight: bold;'><a href=complete.php onclick=\"javascript:window.open(this.href,'popup','resizable=0,height=690,width=550');return false;\" class=texte style='text-align: left;FONT-SIZE: 10pt; font-weight: bold;'><font color=#CC0000 style='text-align: left;FONT-SIZE: 10pt; font-weight: bold;'><b>Concours de septembre (écrit+oral)<\/b><\/font><\/a><\/p>"
messages[1]="<p class=texte style='text-align: left;FONT-SIZE: 10pt; font-weight: bold;'><a href=oral.php onclick=\"javascript:window.open(this.href,'popup','resizable=0,height=690,width=550');return false;\" class=texte style='FONT-SIZE: 10pt; font-weight: bold;text-align: left;'><font color=#CC0000 style='text-align: left;FONT-SIZE: 10pt; font-weight: bold;'><b>Préparation intensive à l'oral<\/b><\/font><\/a><\/p><p class=texte style='FONT-SIZE: 3pt;'>&nbsp;<\/p><p class=texte style='text-align: left;FONT-SIZE: 10pt; font-weight: bold;'><a href=complete.php onclick=\"javascript:window.open(this.href,'popup','resizable=0,height=690,width=550');return false;\" class=texte style='text-align: left;FONT-SIZE: 10pt; font-weight: bold;'><font color=#CC0000 style='text-align: left;FONT-SIZE: 10pt; font-weight: bold;'><b>Concours de septembre (écrit+oral)<\/b><\/font><\/a><\/p>"
messages[2]="<p class=texte style='text-align: left;FONT-SIZE: 10pt; font-weight: bold;'><a href=oral.php onclick=\"javascript:window.open(this.href,'popup','resizable=0,height=690,width=550');return false;\" class=texte style='FONT-SIZE: 10pt; font-weight: bold;text-align: left;'><font color=#CC0000 style='text-align: left;FONT-SIZE: 10pt; font-weight: bold;'><b>Préparation intensive à l'oral<\/b><\/font><\/a><\/p><p class=texte style='FONT-SIZE: 3pt;'>&nbsp;<\/p><p class=texte style='text-align: left;FONT-SIZE: 10pt; font-weight: bold;'><a href=complete.php onclick=\"javascript:window.open(this.href,'popup','resizable=0,height=690,width=550');return false;\" class=texte style='text-align: left;FONT-SIZE: 10pt; font-weight: bold;'><font color=#CC0000 style='text-align: left;FONT-SIZE: 10pt; font-weight: bold;'><b>Concours de septembre (écrit+oral)<\/b><\/font><\/a><\/p>"
messages[3]="<p class=texte style='text-align: left;FONT-SIZE: 10pt; font-weight: bold;'><a href=oral.php onclick=\"javascript:window.open(this.href,'popup','resizable=0,height=690,width=550');return false;\" class=texte style='FONT-SIZE: 10pt; font-weight: bold;text-align: left;'><font color=#CC0000 style='text-align: left;FONT-SIZE: 10pt; font-weight: bold;'><b>Préparation intensive à l'oral<\/b><\/font><\/a><\/p><p class=texte style='FONT-SIZE: 3pt;'>&nbsp;<\/p><p class=texte style='text-align: left;FONT-SIZE: 10pt; font-weight: bold;'><a href=complete.php onclick=\"javascript:window.open(this.href,'popup','resizable=0,height=690,width=550');return false;\" class=texte style='text-align: left;FONT-SIZE: 10pt; font-weight: bold;'><font color=#CC0000 style='text-align: left;FONT-SIZE: 10pt; font-weight: bold;'><b>Concours de septembre (écrit+oral)<\/b><\/font><\/a><\/p>"
///////Do not edit pass this line///////////////////////
if (messages.length>1)
i=2
else
i=0
 
function move1(whichlayer){
    tlayer=eval(whichlayer)
    if (tlayer.top>0&amp;&amp;tlayer.top&lt;=5){
        tlayer.top=0
        settimeout("move1(tlayer)",5000)
        settimeout("move2(document.main.document.second)",5000)
        return
    }
    if (tlayer.top>=tlayer.document.height*-1){
        tlayer.top-=5
        settimeout("move1(tlayer)",100)
    }
    else{
        tlayer.top=scrollerheight
        tlayer.document.write(messages[i])
        tlayer.document.close()
        if (i==messages.length-1)
        i=0
        else
        i++
    }
}
 
function move2(whichlayer){
    tlayer2=eval(whichlayer)
    if (tlayer2.top>0&amp;&amp;tlayer2.top&lt;=5){
        tlayer2.top=0
        settimeout("move2(tlayer2)",5000)
        settimeout("move1(document.main.document.first)",5000)
        return
    }
    if (tlayer2.top>=tlayer2.document.height*-1){
        tlayer2.top-=5
        settimeout("move2(tlayer2)",100)
    }
    else{
        tlayer2.top=scrollerheight
        tlayer2.document.write(messages[i])
        tlayer2.document.close()
        if (i==messages.length-1)
        i=0
        else
        i++
    }
}
 
function move3(whichdiv){
    tdiv=eval(whichdiv)
    if (tdiv.style.pixeltop>0&amp;&amp;tdiv.style.pixeltop&lt;=5){
        tdiv.style.pixeltop=0
        settimeout("move3(tdiv)",5000)
        settimeout("move4(second2)",5000)
        return
    }
    if (tdiv.style.pixeltop>=tdiv.offsetheight*-1){
        tdiv.style.pixeltop-=5
        settimeout("move3(tdiv)",100)
    }
    else{
        tdiv.style.pixeltop=scrollerheight
        tdiv.innerhtml=messages[i]
        if (i==messages.length-1)
        i=0
        else
        i++
    }
}
 
function move4(whichdiv){
    tdiv2=eval(whichdiv)
    if (tdiv2.style.pixeltop>0&amp;&amp;tdiv2.style.pixeltop&lt;=5){
        tdiv2.style.pixeltop=0
        settimeout("move4(tdiv2)",5000)
        settimeout("move3(first2)",5000)
        return
    }
    if (tdiv2.style.pixeltop>=tdiv2.offsetheight*-1){
        tdiv2.style.pixeltop-=5
        settimeout("move4(second2)",100)
    }
    else{
        tdiv2.style.pixeltop=scrollerheight
        tdiv2.innerhtml=messages[i]
        if (i==messages.length-1)
        i=0
        else
        i++
    }
}
 
function startscroll(){
    if (document.all){
        move3(first2)
        second2.style.top=scrollerheight
    }
    else if (document.layers){
        move1(document.main.document.first)
        document.main.document.second.top=scrollerheight+5
        document.main.document.second.visibility='show'
    }
}
 
window.onload=startscroll
 
</script>
 
<ilayer style="id:main; width=&amp;{scrollerwidth}; height=&amp;{scrollerheight}; bgcolor=&amp;{scrollerbgcolor}">
<layer style="id:first;left:0;top:1;width:&amp;{scrollerwidth}">
 
<script language="javascript1.2" type="text/javascript">
if (document.layers)
document.write(messages[0])    
</script>
</layer>
<layer style="id:second;left:0;top:0;width:&amp;{scrollerwidth}; style:visibility:hide">
<script language="javascript1.2" type="text/javascript">
if (document.layers)
document.write(messages[1])
</script>
</layer>
</ilayer>
 
<script language="javascript1.2" type="text/javascript">
if (document.all){
    document.write('<span id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight)
    document.writeln(';overflow:hiden;background-color:'+scrollerbgcolor+">')
    
    
    document.write('<object><div style="position:absolute;width:'+scrollerwidth)
    document.writeln(';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0;top:0">')
    document.writeln('<object><div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0;top:1">')
    document.write(messages[0])
    document.writeln('</div></object>')
    document.writeln('<object><div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0;top:0">')
    document.write(messages[1])
    document.writeln('</div></object>')
    document.writeln('</div></object>')
    document.writeln('</span>')
}
</script>
Merci.

PS : le code n'est pas de moi, je ne fais que reprendre un travail.