如何在firfox环境下获取iframe内对象及其属性,我在ie下写的js脚本都不能用了代码如下:
              var height1=PhotoViewer.images1.height;            
    var width1=PhotoViewer.images1.width;            
    PhotoViewer.images1.height=height1*1.2;          
    PhotoViewer.images1.width=width1*1.2;  
其中images1和images2都是iframe PhotoViewer里的对象,PhotoViewer的src指向另外一个页面,我在主页面中调用它,在firefox里无法获取对象,请高手帮忙啊

解决方案 »

  1.   

    这样引用即可
    PhotoViewer.document.images["images1"].height
      

  2.   

    有没有可调试的html,如果能搭建调试环境可以帮你看看。
      

  3.   

    在FF中用style
    不直接使用height或者width
      

  4.   

    PhotoViewer.document.images["images1"].style.height
    利用这样的
      

  5.   

    Iframe 内部的对象在外不是不能够访问的.安全原因,没有办法的.
      

  6.   

    经过努力,终于找到方法了,代码如下:
    window.frames["PhotoViewer"].document.images["images1"].height
    谢谢各位的帮忙