j'ai remplace par ca
document.wheel.wheel2.selectedIndex =0
ca roule par contre le fait d'avoir remplace les lifgnes
setTimeout("document.wheel.wheel2.selectedIndex =1000",100)
par
setTimeout("document.wheel.wheel2.selectedIndex =count",100)
ne rend pas le decompte fluide
Message envoyé avec : Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)
firefox et scripts
bon pour ce script j'ai reussis en bidouillant avec un autre, si ca interesse quelqu'un le voici compatible ie et firefox avec du son en plus
<HTML>
<HEAD>
<SCRIPT type="text/javascript">
function InsertSound()
{
document.write('<embed src="spin.wav" width="0" height="0" autostart="false" name="mysound1" id="mysound1">');
document.write('</embed>');
document.write('<embed src="fadespin.wav" width="0" height="0" autostart="false" name="mysound2" id="mysound2">');
document.write('</embed>');
}
maxSpinTime=7
minSpinTime=3
running=0
count=0
firstRun=1
hm=document.getElementById&&!document.all
function spinWheel(){
mySelect=document.forms["wheel"]["wheel2"]
maxNum=mySelect.length
if(firstRun==1){
lastNum=maxNum-1
firstRun=0
}
if(running==1){
return
}
running=1
isStopped=0
stopTimeSet=0
startSpinSound()
animate()
}
function animate(){
if(isStopped==0){
timer=setTimeout("animate()",50)
}
else{
running=0
lastNum=count
}
mySelect.selectedIndex=count
if(count==lastNum&&stopTimeSet==0){
stopTime =(minSpinTime+Math.floor(Math.random()*(maxSpinTime-minSpinTime)))*1000
setTimeout("isDone()",stopTime)
setTimeout("stopSpinSound()",stopTime-100)
stopTimeSet=1
}
count=(count==maxNum-1?0:count+1)
}
function isDone(){
isStopped=1
window.location = document.wheel.wheel2.options[document.wheel.wheel2.selectedIndex].value,800;
}
function startSpinSound(){
document.mysound1.Play()
}
function stopSpinSound(){
document.mysound1.Stop()
// if(hm){
// document.mysound1.Rewind()
// }
document.mysound1.Rewind()
document.mysound2.Play()
}
</SCRIPT>
</HEAD>
<BODY bgColor=#fffff0>
<table align="center" width="800" border="0">
<tr>
<td width="300" height="442">
<p align="center"><a href="page1.htm"><img src="s.jpg" width="105" height="50"></a></p>
<p> </p>
<p align="center"><a href="page2.htm"><img src="n.jpg" width="105" height="50"></a></p>
<p> </p>
<p align="center"><a href="page3.htm"><img src="r.jpg" width="105" height="50"></a></p>
</td>
<td width="200">
<p> </p>
<form method="POST" name="wheel">
<p align="center">
<select id="wheel2" name="wheel2" size="6">
<option value="page1.htm" title="page1.htm">page1
<option value="page2.htm" title="page2.htm">page2
<option value="page3.htm" title="page3.htm">page3
<option value="page4.htm" title="page4.htm">page4
<option value="page5.htm" title="page5.htm">page5
<option value="page6.htm" title="page6.htm">page6
</select>
</p>
<P align="center"><INPUT onClick="spinWheel();" type="button" value="Un Poème au hasard !" name="button1"></P>
<p> </p>
</form></td>
<td width="300">
<p align="center"><a href="page4.htm"><img src="i.jpg" width="105" height="50"></a></p>
<p> </p>
<p align="center"><a href="page5.htm"><img src="e.jpg" width="105" height="50"></a></p>
<p> </p>
<p align="center"><a href="page6.htm"><img src="p.jpg" width="105" height="50"></a></p>
</tr>
</table>
<script language="JavaScript"type="text/javascript">InsertSound();</script>
</BODY>
</HTML>
Message envoyé avec : Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)
<HTML>
<HEAD>
<SCRIPT type="text/javascript">
function InsertSound()
{
document.write('<embed src="spin.wav" width="0" height="0" autostart="false" name="mysound1" id="mysound1">');
document.write('</embed>');
document.write('<embed src="fadespin.wav" width="0" height="0" autostart="false" name="mysound2" id="mysound2">');
document.write('</embed>');
}
maxSpinTime=7
minSpinTime=3
running=0
count=0
firstRun=1
hm=document.getElementById&&!document.all
function spinWheel(){
mySelect=document.forms["wheel"]["wheel2"]
maxNum=mySelect.length
if(firstRun==1){
lastNum=maxNum-1
firstRun=0
}
if(running==1){
return
}
running=1
isStopped=0
stopTimeSet=0
startSpinSound()
animate()
}
function animate(){
if(isStopped==0){
timer=setTimeout("animate()",50)
}
else{
running=0
lastNum=count
}
mySelect.selectedIndex=count
if(count==lastNum&&stopTimeSet==0){
stopTime =(minSpinTime+Math.floor(Math.random()*(maxSpinTime-minSpinTime)))*1000
setTimeout("isDone()",stopTime)
setTimeout("stopSpinSound()",stopTime-100)
stopTimeSet=1
}
count=(count==maxNum-1?0:count+1)
}
function isDone(){
isStopped=1
window.location = document.wheel.wheel2.options[document.wheel.wheel2.selectedIndex].value,800;
}
function startSpinSound(){
document.mysound1.Play()
}
function stopSpinSound(){
document.mysound1.Stop()
// if(hm){
// document.mysound1.Rewind()
// }
document.mysound1.Rewind()
document.mysound2.Play()
}
</SCRIPT>
</HEAD>
<BODY bgColor=#fffff0>
<table align="center" width="800" border="0">
<tr>
<td width="300" height="442">
<p align="center"><a href="page1.htm"><img src="s.jpg" width="105" height="50"></a></p>
<p> </p>
<p align="center"><a href="page2.htm"><img src="n.jpg" width="105" height="50"></a></p>
<p> </p>
<p align="center"><a href="page3.htm"><img src="r.jpg" width="105" height="50"></a></p>
</td>
<td width="200">
<p> </p>
<form method="POST" name="wheel">
<p align="center">
<select id="wheel2" name="wheel2" size="6">
<option value="page1.htm" title="page1.htm">page1
<option value="page2.htm" title="page2.htm">page2
<option value="page3.htm" title="page3.htm">page3
<option value="page4.htm" title="page4.htm">page4
<option value="page5.htm" title="page5.htm">page5
<option value="page6.htm" title="page6.htm">page6
</select>
</p>
<P align="center"><INPUT onClick="spinWheel();" type="button" value="Un Poème au hasard !" name="button1"></P>
<p> </p>
</form></td>
<td width="300">
<p align="center"><a href="page4.htm"><img src="i.jpg" width="105" height="50"></a></p>
<p> </p>
<p align="center"><a href="page5.htm"><img src="e.jpg" width="105" height="50"></a></p>
<p> </p>
<p align="center"><a href="page6.htm"><img src="p.jpg" width="105" height="50"></a></p>
</tr>
</table>
<script language="JavaScript"type="text/javascript">InsertSound();</script>
</BODY>
</HTML>
Message envoyé avec : Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)
Qui est en ligne ?
Utilisateurs parcourant ce forum : Aucun utilisateur inscrit et 6 invités