Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/184935-how-do-i-move-a-page-down-automatically/
Share on other sites

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>

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

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.