Log in

View Full Version : IE mouse dragging in iframe



jamiller
05-10-2007, 05:50 PM
So I'm building a site with an iframe. When I view the site in IE6 & 7 I can click and drag my left mouse button inside the iframe to the right almost like scrolling horizontally moving the inner page to the left and right.

I have tried everything to overcome this little bug by setting positions to fixed, messing around with widths of the inner pages and the main page iframe but nothing works.

This does not happen in Firefox. So I'm assuming it's an IE only bug and have searched the interweb for a solution but haven't found anything.

So my question to you is this: Has anybody ever come across this before? Is there a solution?

Veronica
05-10-2007, 08:24 PM
Can you provide a URL to show the problem?

jamiller
05-10-2007, 09:03 PM
What I'm working on is not online but here is something that shows the same problem that I created rather quickly:

http://www.ja-miller.com/iframe.html

edit:// To show the problem I'm talking about, must be viewed in IE

Veronica
05-10-2007, 09:17 PM
I don't see it in IE7 or IE6. Tried it with a trackball mouse and a regular one. Sorry. Anyone else?

jamiller
05-10-2007, 09:32 PM
You highlighted the word "TEST" and dragged your mouse to the left and right while still holding the button down and you didn't see it? For me, in IE7, the text, "TEST" moves to the left and right.

jscheuer1
05-13-2007, 02:32 AM
It is the width of the iframe's border, 2px on either side. In IE this cuts into the the width of the display area by a total of 4px. You can make up these 4 pixels in a number of ways. One is to make the iframe's width be 204px. Another would be to set the iframe's frameborder attribute to 0. You could narrow the test.html's body to 196px. You could probably do other things.

Notes: This is a common problem in IE. It is often known as the box model bug. IE 7 supposedly has fixed many of the bugs in IE, but apparently not the box model bug, at least not as it applies to iframes.