RSS RSS feed | Atom Atom feed | |

Transforming XML in an IFRAME without scroll bars

Eliminate those default scroll bars to clean up you pages

Including XML transformed by XSL-T is a good way to include content in your pages, but Internet Explorer puts a scroll bar on the right side if it is needed or not. Here is how to get rid of them so the content appears to be part of your page.

Here is an example of the problem:

This is only a problem for Internet Explorer as the four other major browsers work correctly. There are two solutions to this problem.

The standard way to handle this would be to control overflow with style attributes. This doesn't work in IE. Alternatively, the standard scrolling tag does eliminate the unneeded bars.

//scrolling tag works
<iframe src="..." height="200" scrolling="no">

//overflow hidden does not
<iframe src="..." height="200" style="overflow: hidden;">
overflow: hidden

The above solution works when you have access to the page that is displaying the XML. If you only have access to the XSL, there is a non-standard way to address the problem. IE implements a scroll tag on the body element. Simply add scroll="no" to the body tag in your XSL file. This will get rid of that annoying nonfunctional scroll bar.

//scroll tag is IE only
<body scroll="no" >
Tags :

Add a comment Send a TrackBack