menu
[ Updated threads · New messages · Members · Forum rules · Search · RSS ]
  • Page 1 of 1
  • 1
Fixing IE overflow problem
guitarmantraDate: Thursday, 2009-06-04, 7:36 AM | Message # 1
Colonel
Group: Administrators
Messages: 220
Awards: 3
Reputation: 2
Status: Offline
One more annoying IE problem is the rendering of the overflow property. Happilly this code can help.

Simply paste the following Javascript code in the head part of your html document, or in a separate .js file:

Code

window.onload = function () {
   // only apply to IE
   if (!/*@cc_on!@*/0) return;

   // find every element to test
   var all = document.getElementsByTagName('*'), i = all.length;

   // fast reverse loop
   while (i--) {
     // if the scrollWidth (the real width) is greater than
     // the visible width, then apply style changes
     if (all[i].scrollWidth > all[i].offsetWidth) {
       all[i].style['paddingBottom'] = '20px';
       all[i].style['overflowY'] = 'hidden';
     }
   }
};

The code, which will only apply to IE, will look for all elements having the well known overflow problem, and fix it. Althought this can be done in pure CSS, this Javascript solution is interresting.

Attachments: 4514623.jpg (16.8 Kb)


www.coredownloadz.ucoz.com
 
  • Page 1 of 1
  • 1
Search: