Witam, i znowu mam problem :/ Mam takie 2 skrypty na stronie:

1. mój
  1. <script type="text/javascript">
  2. // <![CDATA[
  3. var dni = 39;var godzin = 14;var minut = 54;var sekund = 45;
  4.  
  5. function czas() {
  6. if(sekund > 0) {
  7. sekund--;
  8. } else if(minut > 0) {
  9. minut--;
  10. sekund = 59;
  11. } else if(godzin > 0) {
  12. godzin--;
  13. minut = 59;
  14. sekund=59;
  15. } else if(dni > 0) {
  16. dni--;
  17. godzin = 24;
  18. minut = 59;
  19. sekund= 59;
  20. }
  21.  
  22. if(godzin ==0 && minut==0 && sekund==0) {
  23. minut = 1;
  24. }
  25.  
  26. document.getElementById('zegar').innerHTML=
  27. "Pozostało: <br/>Dni: "+dni+"<br/> Godzin: "+godzin+"<br/> Minut: "+(((minut < 10) && (minut > 0)) ? "0" + minut : minut)+"<br/> Sekund: "+((sekund < 10) ? "0" + sekund : sekund)+"<br/> ";
  28.  
  29. setTimeout("czas();", 1000);
  30. }
  31. // ]]>
  32.  
  33. </head>
  34.  
  35. <body onload="czas()">
  36. <div class="spec">odliczanie</div>
  37. <span id="zegar"></span></div>



2. Gdzieś tam go kiedyś znalazłem:
  1. <script type="text/javascript">
  2. // <![CDATA[
  3.  
  4. /*
  5. Cross browser Marquee script- Š Dynamic Drive (www.dynamicdrive.com)
  6. For full source code, 100's more DHTML scripts, and Terms Of Use, visit http://www.dynamicdrive.com
  7. Credit MUST stay intact
  8. */
  9. //Specify the marquee's width (in pixels)
  10. var marqueewidth="720px"
  11. //Specify the marquee's height
  12. var marqueeheight="20px"
  13. //Specify the marquee's marquee speed (larger is faster 1-10)
  14. var marqueespeed=3
  15. //configure background color:
  16. var marqueebgcolor="#F6EBD4"
  17. //Pause marquee onMousever (0=no. 1=yes)?
  18. var pauseit=1
  19.  
  20. //Specify the marquee's content (don't delete <nobr> tag)
  21. //Keep all content on ONE line, and backslash any single quotations (ie: that's great):
  22.  
  23. var marqueecontent='<nobr><span class="bold">jakiś tekst</span></nobr>'
  24. ////NO NEED TO EDIT BELOW THIS LINE////////////
  25. marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
  26. var copyspeed=marqueespeed
  27. var pausespeed=(pauseit==0)? copyspeed: 0
  28. var iedom=document.all||document.getElementById
  29. if (iedom)
  30. document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+marqueecontent+'</span>')
  31. var actualwidth=''
  32. var cross_marquee, ns_marquee
  33. function populate(){
  34. if (iedom){
  35. cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
  36. cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
  37. cross_marquee.innerHTML=marqueecontent
  38. actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
  39. }
  40. else if (document.layers){
  41. ns_marquee=document.ns_marquee.document.ns_marquee2
  42. ns_marquee.left=parseInt(marqueewidth)+8
  43. ns_marquee.document.write(marqueecontent)
  44. ns_marquee.document.close()
  45. actualwidth=ns_marquee.document.width
  46. }
  47. lefttime=setInterval("scrollmarquee()",20)
  48. }
  49. window.onload=populate
  50.  
  51. function scrollmarquee(){
  52. if (iedom){
  53. if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
  54. cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px"
  55. else
  56. cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
  57.  
  58. }
  59. else if (document.layers){
  60. if (ns_marquee.left>(actualwidth*(-1)+8))
  61. ns_marquee.left-=copyspeed
  62. else
  63. ns_marquee.left=parseInt(marqueewidth)+8
  64. }
  65. }
  66.  
  67. if (iedom||document.layers){
  68. with (document){
  69. document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
  70. if (iedom){
  71. write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
  72. write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
  73. write('<div id="iemarquee" style="position:absolute;left:0px;top:0px"></div>')
  74. write('</div></div>')
  75. }
  76. else if (document.layers){
  77. write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
  78. write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
  79. write('</ilayer>')
  80. }
  81. document.write('</td></table>')
  82. }
  83. }
  84. // ]]>


Jeśli usunę ten fragment:
  1. function populate(){
  2. if (iedom){
  3. cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
  4. cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
  5. cross_marquee.innerHTML=marqueecontent
  6. actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
  7. }

z 2. skryptu to 1. mój zaczyna działać ale jak łatwo się domyśleć 2. nie działa sad.gif Myślę że to przez to całe getElementById, ale nie jestem pewien, a jeszcze bardziej nie mam pojęcia co z tym zrobić, pomóżcie proszę.........