Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
6138 connectés 

  FORUM HardWare.fr
  Programmation
  HTML/CSS

  Fonctions incompatibles ???

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Fonctions incompatibles ???

n°986697
Iamagenius
Posté le 18-02-2005 à 23:31:43  profilanswer
 

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 !

mood
Publicité
Posté le 18-02-2005 à 23:31:43  profilanswer
 

n°986926
FlorentG
Posté le 19-02-2005 à 11:40:09  profilanswer
 

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

n°987860
comar91
Posté le 20-02-2005 à 20:24:44  profilanswer
 

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
n°987880
masklinn
í dag viðrar vel til loftárása
Posté le 20-02-2005 à 20:54:07  profilanswer
 

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 by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  HTML/CSS

  Fonctions incompatibles ???

 

Sujets relatifs
Appel Fonctions antérieures / portée , a partir d'autres clips ?equivalence fonctions CFM /PHP
Existe t'il un livre qui regroupe toutes les fonctions JavaUtiliser les fonctions d'une DLL sans avoir le code source.
Declaration des fonctions, ca marche po :-(threads et fonctions membres / visual C++
connection mysql dans plusieurs fonctionsQuestion sur les fonctions??
spécialisation de fonctions membres (template) d'une classe templateFichiers et fonctions
Plus de sujets relatifs à : Fonctions incompatibles ???


Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)