Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using href links to go to specific section within website

Tags:

php

href

xhtml

I am trying to link some text with the href tag to a specific section in my website.

On the homepage I have a quote and then the person's name of who said it. I want to link his name to the "Upcoming Events" tab on my "About" section.

The website is http://www.verticalministries.net. The name "Aaron Ivey" needs to be linked to the "Upcoming Events" tab under the "About" section. The website is a one-page portfolio that scrolls using JavaScript.

I have tried using the name attribute, but that wasn't working because the href tag would look like
<a href="#about#ivey>Aaron Ivey</a> and that just isn't valid code, because I have the page scrolling via classes. I did check the name attribute and I did give it #ivey.

<div class="fifth_page" style="display:none"> 
            <h1>Upcoming Events</h1>
                <h4>Feb. 15 &#45; Aaron Ivey Band</h4> 
                <a name="#ivey"></a>
                <img src="images/iveypromo.jpg" alt="Aaron Mug Shot" class="floatRight img_left_space" />
               <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Aaron Ivey believes that all worship is a response to a creative and compelling God.  Serving as one of the worship pastors at <a href="http://www.austinstone.org" target="_blank">The Austin Stone</a>...</p>  
      </div>

Any help would be greatly appreciated.

If you have any further questions, please let me know.

Thank you.

Sincerely,

DHJolesch

like image 577
dhjolesch Avatar asked Feb 10 '10 07:02

dhjolesch


1 Answers

don't use attribute name it's deprecated, rather use id

example code, how to jump with an anchor to a div with specified id:

<a href="#your-page-element">Jump to ID</a>

<div id="your-page-element">
    will jump here
</div>

Also for scrolling animations with jQuery look at How can I scroll to a specific location on the page using jquery?

like image 195
Juraj Blahunka Avatar answered Oct 29 '22 18:10

Juraj Blahunka