Fonctions incompatibles ???

Fonctions incompatibles ??? - HTML/CSS - Programmation

Marsh Posté le 18-02-2005 à 23:31:43    

Salut !
 
Pourriez-vous me dire pourquoi, quand je desinhibe verti_scroller(), tableau_colorer() ne fonctionne plus ?
 

Code :
  1. <style type="text/css">
  2. #verti_div
  3. {
  4. position:absolute;
  5. width :100%;
  6. height:265%;
  7. }
  8. h1
  9. {
  10. margin-top:15%;
  11. line-height:125%;
  12. margin-left:0;
  13. font-size:211%;
  14. text-align:center;
  15. }
  16. </style>
  17. <div id="verti_div">
  18. <h1 style="margin-top: 38%">Dominique Braschi-Blondeau<br>présente</h1>
  19. <h1>une production de</h1>
  20. <h1>Cosmic Village Productions</h1>
  21. <h1>réalisée par</h1>
  22. <h1>Stéphane Lembaumeur</h1>
  23. </div>
  24. <script type="text/JavaScript">
  25. function verti_scroller()
  26. {
  27. incrementeur-=pas
  28. document.getElementById('verti_div').style.top=incrementeur
  29. if(incrementeur>-1.5*window.innerHeight)
  30. setTimeout('verti_scroller()', laps)
  31. else
  32. alert(document.getElementById('verti_div').style.top)
  33. }
  34. function tableau_colorer()
  35. {
  36. if(t_colorer=='ok')
  37. {
  38. element_no=0
  39. elements_nombre=tableau.length
  40. while(element_no<elements_nombre)
  41. {
  42. element=tableau[element_no]
  43. position=element.offsetTop-document.body.scrollTop
  44. if( 0 < position && position < window.innerHeight / 2 )
  45. taux = position / ( window.innerHeight / 2 )
  46. else if( window.innerHeight / 2 <= position &&  position < window.innerHeight )
  47. taux = ( window.innerHeight - ( position * 1.1 ) ) / ( window.innerHeight / 2 )
  48. else
  49. taux = 0
  50. delta_r = parseInt(coul_bord.slice(1, 3), 16) - parseInt(coul_mil.slice(1, 3), 16)
  51. delta_v = parseInt(coul_bord.slice(3, 5), 16) - parseInt(coul_mil.slice(3, 5), 16)
  52. delta_b = parseInt(coul_bord.slice(5, 7), 16) - parseInt(coul_mil.slice(5, 7), 16)
  53. r_cour = parseInt( parseInt(coul_bord.slice(1, 3), 16) - ( taux * delta_r ) )
  54. v_cour = parseInt( parseInt(coul_bord.slice(3, 5), 16) - ( taux * delta_v ) )
  55. b_cour = parseInt( parseInt(coul_bord.slice(5, 7), 16) - ( taux * delta_b ) )
  56. color_display(element)
  57. element_no++
  58. }
  59. setTimeout('tableau_colorer()', 100)
  60. }
  61. }
  62. function color_display(objet) { objet.style.color = 'rgb(' + r_cour + ',' + v_cour + ',' + b_cour + ')' }
  63. //incrementeur=0; pas=2; laps=1; verti_scroller();
  64. coul_bord=document.bgColor; coul_mil=document.fgColor; t_colorer='ok';
  65. tableau=document.getElementsByTagName('h1'); tableau_colorer()
  66. </script>


 
Merci de votre contribution !

Reply

Marsh Posté le 18-02-2005 à 23:31:43   

Reply

Marsh Posté le 19-02-2005 à 11:40:09    

Met un petit peu d'indentation dans ton code, parce que là c'est galèrede s'y retrouver :/

Reply

Marsh Posté le 20-02-2005 à 20:24:44    

Bonsoir,
Si IE: scrtop=parseInt(document.body.scrollTop);hgt=window.document.body.clientHeight;
Sinon, si NS ou OP:
scrtop=parseInt(window.pageYOffset);hgt=window.innerHeight;


---------------
Comar, http://www.arkha.com
Reply

Marsh Posté le 20-02-2005 à 20:54:07    

Iamagenius -> indente, et oublie pas les ";" à la fin des lignes de code JS (c'est pas nécessaire, mais ça peut servir :o)
 

comar91 a écrit :

Bonsoir,
Si IE: scrtop=parseInt(document.body.scrollTop);hgt=window.document.body.clientHeight;
Sinon, si NS ou OP:
scrtop=parseInt(window.pageYOffset);hgt=window.innerHeight;


 [:mlc]  
et t'as pas honte d'écrire des trucs pareils?


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r
Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed