2012-10-04 44 views
0

我在我的頁面中有一個包裝div,它有數據行。我沒有爲這個div設置任何高度,因爲它應該改變大小,與內容的變化。這個div工作正常與鉻。問題是,在IE和Firefox的div崩潰。我已經注意到,Firefox和IE瀏覽器給予了div的特定高度。但是鉻沒有這樣的問題。請提出解決方案..... 任何幫助表示讚賞....Div高度問題,div在ie和Firefox中摺疊

代碼I正在使用附加

  <div id="list" class="roundBox" style=""> 
       <s:bean name="java.util.HashMap" id="qTableLayout"> 
        <s:param name="tablecolspan" value="%{8}" /> 
       </s:bean> 
       <table class="list"> 
        <s:hidden name="selector"/> 
        <tr> 
         <th >row 1</th> 
         <th >row 2</th> 
         <th >row 3</th> 
         <th >row 4</th> 
         <th >row 5</th> 
         <th class="currency" >row 6</th> 
         <th>row 7</th> 
         <th>row 8</th> 
         <th>&nbsp;</th> 
        </tr> 
        <s:iterator value="logList"> 
         <tr> 
          <td><s:property value="channelId"/></td> 
         <td><s:date format="MM/dd/yyyy HH:mm:ss" name="requestReceiveTime"/></td> 
         <td><s:date format="MM/dd/yyyy HH:mm:ss" name="processBeginTime"/></td> 
         <td><s:date format="MM/dd/yyyy HH:mm:ss" name="processEndTime"/></td> 
         <td><s:date format="MM/dd/yyyy HH:mm:ss" name="responseAccessTime"/></td> 
         <td class="currency"><s:property value="responseTime"/></td> 
         <td>[<s:property value="responseCode"/>] <s:property value="responseDesc"/></td> 

         <td> 

         <sx:a 
          href="showchannel?channelId=%{channelId}&token=%{token}" 
          onclick="javascript:showDropdown('%{token}','show');" executeScripts="true" targets="%{token}channel" 
          title="View Channel Information" id="%{token}showlink"><img src="images/tree_closed.gif"/></sx:a> 
         <a href=javascript:showDropdown('<s:property value="token"/>','hide'); title="Show/Hide Details" id="<s:property value="token"/>hidelink" style="display:none;"><img src="images/tree_open.gif"/></a> 


         </td> 
         <td> 
         <sx:a 
          href="audittrailchannel?channelId=%{channelId}&token=%{token}" 
          onclick="javascript:showauditDropdown('%{token}','show');" 
          executeScripts="true" targets="%{token}auditchannel" title="View Audit Information" 
          id="%{token}showauditlink"><img src="images/down.png" /></sx:a> 
         <a href=javascript:showauditDropdown('<s:property value="token"/>','hide'); title="Show/Hide Details" id="<s:property value="token"/>hideauditlink" style="display:none;"><img src="images/up.png" /></a> 
         </td> 
         </tr> 


         <tr id="<s:property value="token"/>dropdown" style="display: none"> 
          <td colspan="9" valign="top" bgcolor="#a4a4a4"> 

           <table class="reports_details" style="width:100%;" align="left" bgcolor="#ffffe2"> 
            <tr><td colspan="3" style="height: 10px"> 
            <sx:div id="%{token}channel"> 

            </sx:div> 
          </td></tr> 
         <tr> 

          <th>Date</th> 
          <th>Description</th> 
          <th></th> 
         </tr> 
         <tr> 
          <td><s:date format="MM/dd/yyyy HH:mm:ss" name="requestReceiveTime"/></td> 
         <td>channel request</td> 
         <td><a href="#" onclick="showPopup('<s:property value="token"/>Request')">[View]</a></td> 
         </tr> 

         <tr> 
          <td><s:date format="MM/dd/yyyy HH:mm:ss" name="responseAccessTime"/></td> 
         <td>channel response</td> 
         <td><a href="#" onclick="showPopup('<s:property value="token"/>Response')">[View]</a></td> 
         </tr> 


         <s:iterator value="serverLogList"> 
          <tr> 
           <td><s:date format="MM/dd/yyyy HH:mm:ss" name="requestTime"/></td> 
          <td><s:property value="requestType"/></td> 
          <td><a href="#" onClick="showPopup('<s:property value="serverLogId"/>ServerLog')">[View]</a></td> 
          </tr> 


         </s:iterator> 


       </table></td> 

      </tr> 
      <tr id="<s:property value="token"/>auditdropdown" style="display: none;"> 
       <td colspan="9" valign="top" bgcolor="#a4a4a4"> 
      <sx:div id="%{token}auditchannel" cssStyle="height:100px;overflow:scroll"></sx:div> 
      </td> 
      </tr> 

      </s:iterator> 
      <s:if test="logList.size() >= 1"> 
       <tr> 
        <td class="tdLabel" colspan="9"><center><s:a href ='javascript: submitPrev()' > << Previous </s:a><s:property value="pageIndex"/> of <s:property value="pageCount"/><s:a href ='javascript: submitNext()' > Next >> </s:a></center></td> 

       </tr> 
      </s:if> 
      <s:else> 
       <tr><td>No records found</td></tr> 
      </s:else> 


      </table> 

      </div> 
+0

你將不得不設置溢出:自動或溢出:隱藏 – Pramod

+0

請分享您的標記或爲我們提供一個小提琴以解決您的錯誤 –

+0

你能告訴我你的代碼嗎? –

回答

0

你在你的div裏放了什麼? 即使您有任何寬度/高度的樣式,也不會呈現標準html空div標記。 向我們顯示代碼,如果我的回答沒有幫助,所以我們可以看到它是什麼問題。

+0

我已經添加了代碼.... 該div有數據行使用來迭代列表,並基於該迭代顯示數據。每行都有一個圖像點擊該圖像將展開,顯示更多的信息在該行。div得到崩潰時點擊圖像,因爲div的高度改變。這個問題只發生在Firefox和IE瀏覽器,並與鉻合作。 – dileepVikram

+0

你有沒有嘗試設置溢出:汽車在你的課堂上?你有沒有其他的內容可以「竊取」調整大小事件的高度,這樣就沒有剩餘空間了(試着設置一個測試高度)? – YvesR

+0

..感謝您的快速響應.. 實際上,我嘗試了溢出:汽車,現在div不崩潰,並顯示滾動bars.But我想產生相同的效果,如何看chrome.Is有任何方式爲... – dileepVikram