Can you have code to load a page at a certain part of the page?
Hi, does anyone know whether you can make a page to open at a certain part of the page?
I'm wanting to put the navigation menu (being what I want in the center when page loads) in the middle of quite a large page. The menu items will be anchored to the 4 corners of the large page..
I think it's a new concept, haven't seen it done anywhere.. so not sure if code exists..
I'm a newbie to web development, so any help/feedback would be much appreciated!
Hi, You might want to try wrapping your page-center menu in a fragment anchor then add an onload attribute to your body tag to move to the fragment. Something like this...
If the part of your content you want to jump to has an id then just include that after the # on the end of the filename in the link. You can use any id in a web page as an anchor point to jump to.
No, it's not new. It's just an anchor tag.
Originally Posted by k_im_me
Look at the menu here to see it in action. The gray menu at the top of the page scrolls down to the content. This is done like this:
Now, if you put an anchor on the page, it will jump right to that spot on the page.
<a href="http://www.yourpage.com#placeholder">Jump to spot on page</a>
Now click on this link to go to that same page, but right to the letter "M" listings: M
<a name="placeholder"> </a>
There is another way to do it with pixels, but if the page is really big the numbers are WAY OFF in IE and FF, so it is not at all a cross-browser solution.
Last edited by donatello; 01-07-2009 at 11:55 AM.
Reason: adding an example
You don't need the <a name> tag now that no one uses Netscape 4 any more. Any tag at all with an id will work as the destination. For example if the navgation list in the page has an id thern you don't need to change the page at all.
<a href="http://www.yourpage.com#nav">Jump to spot on page</a>
I have tried this bit of code on my page and could not get it to show the link in another table cell! It seem like a great small bit of code to use. Is it able to be used when a menu click is to load another page in a cell next to it?
How about any way to open the main page at a certain point when entering the website. not just create the link in the page.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)