Animating a scroll to an anchor

Discussion in 'jQuery' started by twocats2, Sep 17, 2012.

  1. #1
    Hi, I am new to javascript / jquery so please bear with my ignorance.

    I am creating a web page in html, and i want to use links/anchors to animate scrolling both vertically and horizontally.

    My links/anchors work fine (in that clicking on a link will make a fast jump to the position of the related anchor on the page). I am trying to use localscroll / scrollto to animate this with no success.

    My code (simplified anchors/links as an example);
    Between <head> and </head>
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script src="/jquery.scrollTo-1.4.3.1.js"></script>
    <script src="/jquery.localscroll-1.2.7-min.js"></script>


    Before </body>
    <script type="text/javascript">
    $(document).ready(function(){
    $('#bookmark2').localScroll({
    axis:'xy',
    });
    }</script>

    Anchor;
    <a name="bookmark2">&nbsp;</a>

    Link;
    <ul type=none
    <li><a href="#bookmark2" STYLE="TEXT-DECORATION: NONE"onMouseOver="show4()" onMouseOut="hide4();"<div id="img4" </div</a
    ><div><font style="font-size:27px" color="#FFFFFF" face="Broadway">ROOMS</font></div> </li></ul>

    I am looking to understand/learn exactly what it is I am missing here and where I am going wrong so I can improve on my knowledge. I would appreciate any help given.
     
    twocats2, Sep 17, 2012 IP