开发中遇到一个焦点图切换的问题,下面这个代码在单 独页面中能取到offsetwidth和offsetheight,但是放到其它页面集成的时候就取不到了,取的时候offsetwidth和offsetheight全为0,请教为什么,怎么才能正常取值呢, _slider是个table
this.Change = this.options.Change ? this.options.Change :this._slider[bVertical ? "offsetHeight" : "offsetWidth"] / this._count;table id="idSlider2" border="0" cellpadding="0" cellspacing="0" >
<tbody>
<tr>
<td class="td_f"><a href="http://www.lanrentuku.com/" target="_blank"><img src="images/11.jpg"></a></td>
<td class="td_f"><a href="http://www.lanrentuku.com/" target="_blank"><img src="images/22.jpg"></a></td>
<td class="td_f"><a href="http://www.lanrentuku.com/" target="_blank"><img src="images/33.jpg"></a></td>
<td class="td_f"><ahref="http://www.lanrentuku.com/" target="_blank"><img src="images/44.jpg"></a></td>
<td class="td_f"><a href="http://www.lanrentuku.com/" target="_blank"><img src="images/55.jpg"></a></td>
<td class="td_f"><a href="http://www.lanrentuku.com/" target="_blank"><img src="images/05.jpg"></a></td>
<td class="td_f"><a href="http://www.lanrentuku.com/" target="_blank"><img src="images/05.jpg"></a></td>
<td class="td_f"><a href="http://www.lanrentuku.com/" target="_blank"><img src="images/05.jpg"></a></td>
</tr></tbody></table>
this.Change = this.options.Change ? this.options.Change :this._slider[bVertical ? "offsetHeight" : "offsetWidth"] / this._count;table id="idSlider2" border="0" cellpadding="0" cellspacing="0" >
<tbody>
<tr>
<td class="td_f"><a href="http://www.lanrentuku.com/" target="_blank"><img src="images/11.jpg"></a></td>
<td class="td_f"><a href="http://www.lanrentuku.com/" target="_blank"><img src="images/22.jpg"></a></td>
<td class="td_f"><a href="http://www.lanrentuku.com/" target="_blank"><img src="images/33.jpg"></a></td>
<td class="td_f"><ahref="http://www.lanrentuku.com/" target="_blank"><img src="images/44.jpg"></a></td>
<td class="td_f"><a href="http://www.lanrentuku.com/" target="_blank"><img src="images/55.jpg"></a></td>
<td class="td_f"><a href="http://www.lanrentuku.com/" target="_blank"><img src="images/05.jpg"></a></td>
<td class="td_f"><a href="http://www.lanrentuku.com/" target="_blank"><img src="images/05.jpg"></a></td>
<td class="td_f"><a href="http://www.lanrentuku.com/" target="_blank"><img src="images/05.jpg"></a></td>
</tr></tbody></table>
http://www.cnblogs.com/suzongwei/archive/2009/02/23/1396337.html然后要说明的是, offset系列因为浏览器对CSS解析的差异一直很不靠谱, 比较麻烦.