fry2010 Posted March 24, 2009 Share Posted March 24, 2009 I wondered how to actually anchor a page so that when a user refreshes the page they are taken to exacly the place they was before instead of the top of the page. Scrolling down is a bit annoying, i have seen it on other sites but never knew how to do this.... I think this is a html thing.... help is appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/150795-how-to-anchor-a-page/ Share on other sites More sharing options...
fry2010 Posted March 24, 2009 Author Share Posted March 24, 2009 Does anyone know how this is done or what i mean? Ill give an example... Im on the home page. I scroll down all the way to the bottom. I dont click anything, but refresh the page. When I refresh the page I am taken straight back to the bottom of the home page automatically without needing to scroll down. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/150795-how-to-anchor-a-page/#findComment-792694 Share on other sites More sharing options...
fry2010 Posted March 25, 2009 Author Share Posted March 25, 2009 this site has it working too. If you scroll down then refresh you go back to exactly where u was before. Quote Link to comment https://forums.phpfreaks.com/topic/150795-how-to-anchor-a-page/#findComment-793262 Share on other sites More sharing options...
The Little Guy Posted March 25, 2009 Share Posted March 25, 2009 It is JavaScript, you should give this a try: http://blogs.x2line.com/al/articles/156.aspx Quote Link to comment https://forums.phpfreaks.com/topic/150795-how-to-anchor-a-page/#findComment-793272 Share on other sites More sharing options...
fry2010 Posted March 25, 2009 Author Share Posted March 25, 2009 great thanks for the link. I couldnt find anything. I cant actually get it to work though. I am placing the code inside <script> tags set to javascript but it doesnt work. I have also just looked at using the html anchor tags, but I cant get those to work either. I read somewhere it says about using mouse over events such as onmouseover, but how do I get that to work when I refresh the page? any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/150795-how-to-anchor-a-page/#findComment-793312 Share on other sites More sharing options...
Brian W Posted March 25, 2009 Share Posted March 25, 2009 are you using a js debugger? if so, which one? if not, may I suggest firebug for firefox (if you don't have firefox, dl it or die a painful death *cough, that was rude :-) Quote Link to comment https://forums.phpfreaks.com/topic/150795-how-to-anchor-a-page/#findComment-793722 Share on other sites More sharing options...
fry2010 Posted March 25, 2009 Author Share Posted March 25, 2009 lol, yeah i have it. didt even realise it could correct javascript issues. Good little tool the old firebug. I think I would like to avoid the javascript one though, I would prefere to use the anchor method. I know its not as specific to where you land on the page as javascript is, but its in the w3c docs. They just dont explain how to use mouse events, like onmouseover. If I can get onmouseover working with anchor that would be great. Quote Link to comment https://forums.phpfreaks.com/topic/150795-how-to-anchor-a-page/#findComment-794032 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.