2

I have a page (pageA) that contains tabbed panes, the content of each pane is represented by a DIV element and it has a unique ID e.g id="tab1"

<div id="tab1">Contents of tab</div>

I have another page (pageB) that has an A element that links to a specific tab

<a href="otherpage.html#tab2">Tab 2</a>

On IE7 pageA with the tabs on will only scroll if I open the link in a new window from pageB

Has anyone come across this issue and knows how to fix it?

gunnx
  • 1,229
  • 7
  • 16

1 Answers1

0

I've noticed that the url that is being constructed by the anchor in IE7 is not valid:

<a href='#skipNav'>Skip</a> -> <url>/#/skipNav

so the easiest solution is to place a full url with # in the anchor. This will prevent IE7 to construct it from scratch (url should be server side generated in order to avoid Dev/Test/Qa/Prd transformation problems):

<a href='<url>/#skipNav'>Sip</a>

EDIT: if the error still occurs try adding a random query string. It's a dirty solution but what is not dirty in IE7

EDIT: here's a great example of another approach: window.location = #anchor doesn't work in IE In a nutshell:

 <a href="#" onclick="window.scrollTo(0, 0); return false;'">Back to top</a>
Community
  • 1
  • 1
Dave
  • 349
  • 1
  • 15