Mam problem z poniższym skryptem. Otóż pod Firefoxem śmiga jak się patrzy ale niestety pod IE wywala błąd

  1. Nieprawidłowy argument
  2. Wiersz: 6
  3. Znak: 1


Oto skrypt:

  1. function img(width,height,file){
  2.  
  3. document.getElementById('photo2').className='alt3';
  4. document.getElementById('photo').style.left=window.innerWidth/2;
  5. document.getElementById('photo').style.top=window.innerHeight/2;
  6. document.getElementById('photo').style.width=60;
  7. document.getElementById('photo').style.height=60;
  8. document.getElementById('photo').className='alt4';
  9.  
  10. document.getElementById('photo3').style.width='100%';
  11. document.getElementById('photo3').style.height='100%';
  12. document.getElementById('photo3').className='alt4';
  13.  
  14. document.getElementById('photo4').style.width='100%';
  15. document.getElementById('photo4').style.height='100%';
  16. document.getElementById('photo4').className='alt4';
  17.  
  18. var max_width=window.innerWidth-60;
  19. var max_height=window.innerHeight-60;
  20. var new_width=width;
  21. var new_height=height;
  22. var scale=1;
  23. var scale_1=max_height/height;
  24. var scale_2=max_width/width;
  25.  
  26. if(scale_1<scale_2){scale=scale_1;}
  27. else{scale=scale_2;}
  28.  
  29.  
  30. if(scale<1){
  31. new_width = width * scale;
  32. new_height = height * scale;
  33. }
  34.  
  35. img2(new_width+30,new_height+30,0,0,''+file+'');
  36.  
  37. }
  38.  
  39. function img2(width,height,a,b,file){
  40. a++;
  41.  
  42. if(a<10){setTimeout("img2("+width+","+height+","+a+","+b+",'"+file+"')",50);}
  43.  
  44. document.getElementById('photo').style.width=(a/10)*width;
  45. document.getElementById('photo').style.left=(window.innerWidth/2)-((a/10)*(width/2));
  46.  
  47. if(a==10){img3(width,height,a,b,file);}
  48.  
  49. }
  50.  
  51. function img3(width,height,a,b,file){
  52. b++;
  53.  
  54. if(b<10){setTimeout("img3("+width+","+height+","+a+","+b+",'"+file+"')",50);}
  55.  
  56. document.getElementById('photo').style.height=(b/10)*height;
  57. document.getElementById('photo').style.top=(window.innerHeight/2)-((b/10)*(height/2));
  58.  
  59. if(b==10){img4(''+file+'',width,height);}
  60.  
  61. }
  62.  
  63. function img4(msg,width,height){
  64.  
  65. document.getElementById('photo2').style.height=height;
  66. document.getElementById('photo2').style.top=(window.innerHeight/2)-(height/2);
  67. document.getElementById('photo2').style.width=width;
  68. document.getElementById('photo2').style.left=(window.innerWidth/2)-(width/2);
  69. document.getElementById('photo2').innerHTML='<IMG SRC=''+msg+'\' STYLE="MARGIN-TOP:15px;WIDTH:'+(width-30)+'px;HEIGHT:'+(height-30)+'px;" onLoad="img5();" onClick="hide();">';
  70.  
  71.  
  72. }
  73.  
  74. function img5(){
  75. document.getElementById('photo2').className='alt4';
  76. }
  77.  
  78.  
  79. function hide(){
  80. document.getElementById('photo2').className='alt3';
  81. document.getElementById('photo').className='alt3';
  82. document.getElementById('photo3').className='alt3';
  83. document.getElementById('photo4').className='alt3';
  84. }


Zadaniem powyższego skryptu jest wyświetlenie animowanej tablicy (rozszeżającej się od środka wzdłuż a potem w szerz) i wstawienie na niej zdjęcia.

Dla osób ciekawych jak to powinno wyglądać i nających Firefox zapraszam...

http://fnxnet.domenomania.pl/87dpg/index.p...&photo_id=6

Jeśli ktoś wie gdzie jest błąd proszę o pomoc.