AvatarLand Razer AvatarLand Razer - 1 year ago 63
HTML Question

urls for specific parts of a page

I have a marquee that I use on every single page (part of the navigationbar), It has a few different lines it can chose to echo 1 line at a time. One of those contain a link

<a href="/link" class="a">link</a>
how can i make it redirect me to a specific part of the index?

I found this

var tempDiv = $("<div />");
tempDiv.load("page-to-load.htm", function() {
var content = tempDiv.find("#main");
var title = tempDiv.find("title");
var nav = tempDiv.find("ul.nav");

But not sure how it works.
for a better understanding of what i am looking for http://www.swtor.com/dark-vs-light/home (best link i could find that have this).

by changing the url from
to something like
it scrolls down to a different div.

I use same class on many different divs on the index so if it could work with id or name that whould be better. but could someone please explain how this work and if possible to link from one page to another by using
? (can use .htaccess for mod rewrite)

Answer Source

You are looking for anchor which is done using a combination of id attribute and links. The anchor on the link must be the id that you give to the element to you want to reach.


<a href="#intro">Introduction</a>
<div id="intro">
  Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolore animi enim, beatae vitae nostrum ad, necessitatibus sit aperiam perferendis impedit nemo, saepe! Inventore quam aliquid laboriosam dolor perspiciatis, nemo a.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download