I am having trouble with the showHide function loading the page position correctly. I have one page (Pg1) that contains several divs which all showHide just perfectly (leaving the page in place with the top of the page at the top instead of the top of the div content at the top). However, when I call the showHide function from one of the other pages (Pg2, Pg3, etc) using href, (Pg1) loads and the correct div requested shows, but the page loads in the browser with the content of that div at the top. I need this function to work so that the entire page is in view, but the text in the div requested simply shows in the appropriate cell on that page. I know most people are loving the jump features, but i don't want my page to jump, I need it to remain fully in view weather using the showHide function from within the same page, or calling it from an external link. Can anyone help? I've included code below for both working (within page) and malfunctioning (when calling from an externalpage) Thanks in advance malfunctioning (when calling from an externalpage) <script type="text/javascript"> function Show(What, CheckURL) { var a, i; if (CheckURL) { i = document.URL.indexOf("#"); if(i != -1) { Show(document.URL.substring(i+1,document.URL.length)); return; } } if (!document.getElementsByTagName) return; a = document.body.getElementsByTagName("div"); if (a.length == 0) return; if (typeof a[0].style != 'object') return; if (typeof a[0].style.display == 'undefined') return; for (i = 0; i < a.length; i++) { if (a[i].className != "section") continue; if (a[i].id != What) a[i].style.display = "none"; else a[i].style.display = "block"; } return true; } </script> Code (markup): Then within the body: <a href="javascript:parent.location.replace('javaswitch.html?showHide=#dd')";> Code (markup): I've also tried <a href="javaswitch.html"; onClick="Show('#dd')"> Code (markup): which also works, but has the same malfunction. working (within page) showHide <script type="text/javascript"> function Show(What, CheckURL) { var a, i; if (CheckURL) { i = document.URL.indexOf("#"); if(i != -1) { Show(document.URL.substring(i+1,document.URL.length)); return; } } if (!document.getElementsByTagName) return; a = document.body.getElementsByTagName("div"); if (a.length == 0) return; if (typeof a[0].style != 'object') return; if (typeof a[0].style.display == 'undefined') return; for (i = 0; i < a.length; i++) { if (a[i].className != "section") continue; if (a[i].id != What) a[i].style.display = "none"; else a[i].style.display = "block"; } return true; } </script> Code (markup): Then within the body: <a href="javascript:showHide('#da')"; class="ms_leftnav" onClick="Show('da');">da title</a> Code (markup): I don't really understand why the code within the page is working and the code linking externally is not - any help is appreciated.
If i did got what you want, then, you can't call a function from external page (not from the same domain), it's a security issue and IE (and probably other browsers) don't allow it.