Sample code:
Using inline attribute on iframe seems to fix this issue in IE8:
Go!
update by request:
You should try writing more unobtrusive javascript. Writing code in such way may prevent you from such strange bugs in IE.