tecmeister Posted December 13, 2009 Share Posted December 13, 2009 Hi guys, The title of my question problem seems a bit confusing, so I'll try and explain it to the best of my ability. I'm trying to make my web site move down to the news that they have selected on in the home page. Rather than always start at the top and have to move down there self. How do I do so? Thanks, tecmeister. Quote Link to comment https://forums.phpfreaks.com/topic/184935-how-do-i-move-a-page-down-automatically/ Share on other sites More sharing options...
RussellReal Posted December 13, 2009 Share Posted December 13, 2009 make the link they click on the homepage an id link.. well thats what I call it idk what the real world calls it: for example: <a href="news.php#theNewsElementId">The News Element Name</a> then when they go to that page thru that link.. the page will drag the browser's client area down to where it is visible within the client area.. it will drag to the element with similar html to this: <h1 id="theNewsElementId">The News Element Name</h1> Quote Link to comment https://forums.phpfreaks.com/topic/184935-how-do-i-move-a-page-down-automatically/#findComment-976270 Share on other sites More sharing options...
GFXUniverse Posted December 13, 2009 Share Posted December 13, 2009 RussellReal is right it goes to the target id if the person clicks on it but if you open the news.php page first it will not work for this you will have to automatically redirect your user to the target heading or link. use this <?php echo"<meta http-equiv='REFRESH' content='0;url=news.php#theNewsElementId'>"; ?> page content <h1 id="theNewsElementId">The News Element Name</h1> news started here Quote Link to comment https://forums.phpfreaks.com/topic/184935-how-do-i-move-a-page-down-automatically/#findComment-976275 Share on other sites More sharing options...
emopoops Posted December 13, 2009 Share Posted December 13, 2009 url.com#nameofsomething then a link to click on works to. <a href="#nameofsomething">click</a> and then this is different than the h1 as stated above: <a name="nameofsomething></a> u dont have to put anything in it. just place it where u want to go Quote Link to comment https://forums.phpfreaks.com/topic/184935-how-do-i-move-a-page-down-automatically/#findComment-976316 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.