html 文本溢出,确定HTML元素的内容是否溢出
生活随笔
收集整理的這篇文章主要介紹了
html 文本溢出,确定HTML元素的内容是否溢出
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
通常情況下,你可以比較client[Height|Width]使用scroll[Height|Width],以檢測這種...但值是相同的,當(dāng)溢出是可見的。因此,檢測例程必須考慮到這一點(diǎn)://?Determines?if?the?passed?element?is?overflowing?its?bounds,//?either?vertically?or?horizontally.//?Will?temporarily?modify?the?"overflow"?style?to?detect?this//?if?necessary.function?checkOverflow(el){
var?curOverflow?=?el.style.overflow;
if?(?!curOverflow?||?curOverflow?===?"visible"?)
el.style.overflow?=?"hidden";
var?isOverflowing?=?el.clientWidth?
||?el.clientHeight?
el.style.overflow?=?curOverflow;
return?isOverflowing;}
測試在FF3,FF40.0.2,IE6,Chrome 0.2.149.30中。
總結(jié)
以上是生活随笔為你收集整理的html 文本溢出,确定HTML元素的内容是否溢出的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: chrome java插件_Java程序
- 下一篇: django开源电子文档管理系统_Pyt