Просмотр файла cms/screen/use.js

Размер файла: 1.22Kb
  1. todo.onload(function(){
  2. todo.gallery('gallery');
  3. });
  4.  
  5.  
  6. function hide_img(num){
  7. var scr=document.getElementById("app"+num);
  8. tagList = scr.getElementsByTagName("a");
  9.  
  10. document.getElementById('butt'+num).onclick=function()
  11. {
  12. return getIMG(num);
  13. }
  14. document.getElementById('butt'+num).src="../screen/show.gif";
  15.  
  16. for (var i = 0; i < tagList.length; i++)
  17. {
  18. tagList[i].attributes[1].nodeValue="";//Атрибут href
  19. tagList[i].innerHTML="";
  20. }
  21. }
  22.  
  23.  
  24.  
  25. function getIMG(num)
  26. {
  27. var scr=document.getElementById("app"+num);
  28. document.getElementById('butt'+num).onclick=function()
  29. {
  30. return hide_img(num);
  31. }
  32. document.getElementById('butt'+num).src="../screen/hide.gif";
  33.  
  34. tagList = scr.getElementsByTagName("a");
  35. for (var i = 0; i < tagList.length; i++)
  36. {
  37. var path=i+1;
  38. tagList[i].attributes[0].nodeValue="http://java-virys.narod.ru/screen/imgs/"+num+"/"+path+".png";//Атрибут href
  39. tagList[i].innerHTML="<img src=http://java-virys.narod.ru/screen/imgs/"+num+"/"+path+".png width=25 height=25>";
  40. //tagList[i].rel="gallery["+num+"]";//Изменить параметр соответственно
  41. tagList[i].attributes[1].nodeValue="gallery["+num+"]";
  42. //document.write(tagList[i].rel+"="+tagList[i].attributes[1].nodeValue);
  43. }
  44.  
  45. }