1// Determines if the passed element is overflowing its bounds,
2// either vertically or horizontally.
3// Will temporarily modify the "overflow" style to detect this
4// if necessary.
5function checkOverflow(el)
6{
7 var curOverflow = el.style.overflow;
8
9 if ( !curOverflow || curOverflow === "visible" )
10 el.style.overflow = "hidden";
11
12 var isOverflowing = el.clientWidth < el.scrollWidth
13 || el.clientHeight < el.scrollHeight;
14
15 el.style.overflow = curOverflow;
16
17 return isOverflowing;
18}