ZoomDiv.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. var indexz = "1"
  2. var tempwidth, tempwidth2, tempheight, tempheight2, temptop, temptop2, templeft, templeft2;
  3. var defheight = "99%"// Ĭ�����ʱ�ĸ�
  4. var defwidth = "99.5%"// Ĭ�����ʱ�Ŀ�
  5. function changWH(obj1, obj2) {// Ҫ�Ŵ��div��id,Ҫ���icon��id
  6. indexz = parseInt(indexz) + 1
  7. var obj1 = document.getElementById(obj1)
  8. var obj2 = document.getElementById(obj2)
  9. tempwidth = obj1.style.width;
  10. tempheight = obj1.style.height;
  11. temptop = obj1.style.top;
  12. templeft = obj1.style.left;
  13. if (tempwidth == defwidth) {
  14. with (obj1.style) {
  15. width = tempwidth2
  16. height = tempheight2
  17. left = templeft2
  18. top = temptop2
  19. zIndex = indexz
  20. // alert("111width="+width+" height="+height);
  21. }
  22. obj2.innerHTML = "1"
  23. }// ���icon
  24. else {
  25. tempwidth2 = tempwidth;
  26. tempheight2 = tempheight;
  27. temptop2 = temptop;
  28. templeft2 = templeft;
  29. with (obj1.style) {
  30. width = defwidth
  31. height = defheight
  32. top = "1"
  33. left = "4"
  34. zIndex = indexz
  35. // alert("222width="+width+" height="+height);
  36. }
  37. obj2.innerHTML = "2"
  38. }// ����icon
  39. }