If you go there, you should be dropped down into the footer because the element has the id "foot". In Firefox and Opera, it doesn't take you down to the bottom unless you put your cursor back in the address bar and click return again. I need the ability to direct users to a section of the page based on this.
Hm, it does indeed work with JavaScript turned off. The funny thing is that what made me investigate this is that it's happening in a project i'm working on (so it's not only MSN).
There is a lot of AJAX going on in my project, so I'm guessing it's somehow related. This one is going to be tricky!
It's definitely something with the script. Thanks for your help fellas.
I've narrowed the issue down and found that this is the piece of the script that causes the targeting to fail:
Code:
$("#main .scroll-wrap").css('height', '200px');
I'm basically resizing the content area based on the users window size (in the example above I've simply put '200px'). The targeted #whatever is inside the scroll-wrap div, so when it resizes, FF must put the user back to the top of the document instead of going down to #whatever.
I'm thinking I can tweak the script to extract the targeted element from the URL then go to it.
Just wanted to post the working tweak if anyone cares!
Code:
// firefox wouldn't go to target on load due to resizing, so this function was created
function goToTarget(){
var myLocation = document.location.hash.replace("#","");
if (myLocation) {
myLocation = '#' + myLocation;
window.open(myLocation,'_self')
};
};
// firefox needs to call this to go to the selected target
goToTarget();
Bookmarks