Microsoft KB Archive/255541

= PRB: Fragment Identifiers, ScrollIntoView Fail With Scroll=No =

Article ID: 255541

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Internet Explorer 5.0
 * Microsoft Internet Explorer 5.01

-



This article was previously published under Q255541



SUMMARY
The DHTML scrollIntoView function and hyperlinks that use fragment identifiers fail to scroll a document for which scrolling has been disabled.

Earlier versions of Internet Explorer have allowed this behavior.



CAUSE
Documents have no scrolling capability if scrolling has been disabled on the window.



RESOLUTION
To resolve this problem, re-enable scrolling by removing SCROLL=NO from the BODY element or stop using "scroll: no" in the style information for the BODY.

Replacing these items with a style of "overflow:hidden" creates a window without scrollbars that is still scrollable through script or hyperlinks with fragment identifiers. Note, however, that the user will still not be able to scroll using PAGE UP and PAGE DOWN keys.  ... 



Steps to Reproduce Behavior
Create the following three HTM files:

1.HTM       2.HTM  Goto Section 1<BR> Goto Section 2</A><BR> Goto Section 3</A><BR> </HTML> 3.HTM  <BODY SCROLL=NO> <DIV ID=section1 STYLE="position:absolute;top:0"> This is section 1<BR> <input type=button value="Scroll to section 3" onclick="section3.scrollIntoView(true)"> </DIV> <DIV ID=section2 STYLE="position:absolute;top:4000"> This is section 2 <DIV> <DIV ID=section3 STYLE="position:absolute;top:8000"> This is section 3 </DIV> </BODY> </HTML> In the left frame, click on the three different hyperlinks. In earlier versions of Internet Explorer, the main frame would scroll to the respective sections. In Internet Explorer 5 and later, the main frame will not scroll at all.

<div class="status_section">

STATUS
This behavior is by design.

Keywords: kbnavigation kbprb kbdhtml KB255541

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.