---
title: "view.getComputedStyle(div.firstChild.firstChild, null) is null"
author: "编程足球"
date: "2012-11-07T15:13:49Z"
tags: []
categories: ["Web前端"]
slug: "view-getcomputedstyle-div-firstchild-firstchild-null-is-null"
draft: false
lastmod: "2012-11-07T15:13:49Z"
id: 1718418
url: "https://lingf.iteye.com/blog/1718418"
---

最近在开发时候发现一个很奇怪的错误:

![](http://dl.iteye.com/upload/attachment/0076/2833/5380d818-7f5c-331e-892b-e4e83f378c0d.jpg)


Ext 代码如下:

```java

var east = new Ext.Panel({
        region:'east',
        margins:'5 0 5 5',
        //split:false,
        width: 350,
        layout:'fit',
        //title:'讨论区',
        autoScroll :true,
        html:'<iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="web/analyse/remark.jsp?orId=' + orId + '&arId=' + arId + '"></iframe>',
        collapsed: true,
        collapsible: true,
        title: '讨论区',
        plugins: [ext.ux.panelcollapsedtitle],
        listeners:{  
  	 		"beforecollapse":function(panel){  
  				panel.setTitle("点击可展开讨论区,或点击上面<<展开并固定讨论区");
    		},
    		"beforeexpand":function(panel){  
  				panel.setTitle("讨论区");
    		}    
    	}
                //tbar:tbar,
        //contentEl:'or_infor'
    });

```


很奇怪的一个bug，发现每次点击页面闭合或展开后Panel的iFrame每次都重新加载，并且保持
解决方案就是设置属性

```java

hideMode :'visibility',

```


就不会报错。

目前的情况就是每次点击展开和合并Panel，页面都会重新加载，有高手希望可以解答下。