The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> I can not figure out for the life of me why the link will not work
Turpy
post Oct 20 2011, 04:55 PM
Post #1





Group: Members
Posts: 3
Joined: 20-October 11
Member No.: 15,677



I am creating a website for my wedding and I am using a template that my wife liked and editing it to what we are looking for.

It comes as a one page and the navigation at the top scrolls it down to the desired ID

The problem comes that I want to add links in the navigation out of that one page and it will not leave and for the life of me I can not figure out why! Here is the code below I hope someone sees what my limited experience is not able to the website right now is brandon-and-summer.com

Main Page Navigation
CODE

<nav>
                <div class="before"></div>
                <ul>
                     <li><a href="#about_us">About us</a></li>
                     <li><a href="#wedding_party">Wedding party</a></li>
                     <li><a href="#photos">Photos</a></li>
                     <li><a href="#contact">Online RSVP</a></li>
                     <li><a href="#http://www.brandon-and-summer/brandon">Brandon's Blog</a></li>
                     <li class="last"><a href="http://www.brandon-and-summer/summer">Summer's Blog</a></li>
                </ul>
                <div class="after"></div>
            </nav>
            <!-- END Navigation -->


CSS for the Navigation

CODE

/* -- NAVIGATION -- */
nav {
    background: url('../images/nav_bg.png') 50% 50% repeat-x transparent;
    font-size: 1.4em;
    line-height: 40px;
    height: 38px;
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 46px;
    padding: 7px 0 8px 0;
    position: relative;
    width: auto;
}

nav .before {
    background: url('../images/nav_before_bg.png') 0 0 no-repeat transparent;
    width: 66px;
    left: -66px;
    top: 1px;
}

nav .after {
    background: url('../images/nav_after_bg.png') 0 0 no-repeat transparent;
    width: 61px;
    right: -61px;
    top: 1px;
}

nav li {
    display: inline;
    margin: 0 17px 0 0;
}

nav li.last {
    margin: 0;
}

nav li:after {
    color: #597278;
    content: "♥";
    margin-left: 17px;
}

nav li.last:after {
    content: "";
}

nav a {
    color: #ffffff;
    text-decoration: none;
    -webkit-transition: all 0.15s ease-in-out; -moz-transition: all 0.15s ease-in-out; -o-transition: all 0.15s ease-in-out; -ms-transition: all 0.15s ease-in-out;
}

nav a:hover {
    color: #ffe8b0;
}



JS for the Navigation (where I think the problem lies but cant figure it out
CODE

    /* navigation */
    $('nav a').click(function(ev){
        ev.preventDefault();
        
        $.scrollTo($(this).attr('href'), 220);
    });


What can I do to get the navigation to go to a page out of that main page? I hope there is a way
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Turpy
post Oct 20 2011, 04:58 PM
Post #2





Group: Members
Posts: 3
Joined: 20-October 11
Member No.: 15,677



Also in the html nav where it says
<li><a href="#http://www.brandon-and-summer/brandon">Brandon's Blog</a></li>
the "#" is actually not there I was playing with things on my copy so it actually is

<li><a href="http://www.brandon-and-summer/brandon">Brandon's Blog</a></li>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Turpy
post Oct 20 2011, 05:13 PM
Post #3





Group: Members
Posts: 3
Joined: 20-October 11
Member No.: 15,677



Just as I post this for help i figure it out!

It was in the JS I just removed

" ev.preventDefault();"

and it works like a charm!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Oct 21 2011, 04:56 AM
Post #4


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



Good for you!

I wish you both a happy wedding and good luck.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 21st September 2019 - 06:53 PM