jQuery: The Write Less, Do More JavaScript Library

jQuery localScroll target problem

View: New views
3 Messages — Rating Filter:   Alert me  

jQuery localScroll target problem

by Frozzare :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello.

I don't get jquery localscroll target setting work right. I want to
scroll the div's in #content div, but it's not working.

my js code:

        $(document).ready(function() {
            $('ul.nav').localScroll({
                target: '#content',
                axis: 'xy',
                queue: true
            });
        });

my html code:

<div id="left" class="left">
            <ul class="nav">
                <li><a href="#home">Hem</a></li>
                <li><a href="#about">Om mig</a></li>
                <li><a href="#work">Mitt arbete</a></li>
                <li><a href="#contact">Kontakt</a></li>
            </ul>
</div>
<div id="content" class="page right">
            <div id="home">
                <h3>
                    Hem</h3>
            </div>
            <div id="about">
                <h3>
                    Om mig</h3>
            </div>
            <div id="work">
                <h3>
                    Mitt arbete</h3>
            </div>
            <div id="contact">
                <h3>
                    Kontakt</h3>
            </div>
</div>

Re: jQuery localScroll target problem

by christophe ld :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


hi,

did you try $.scrollTo($("#content")); ?

christophe

Re: jQuery localScroll target problem

by Ariel Flesler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


That should work correctly. Do you have a demo online ?

--
Ariel Flesler

On Jul 2, 3:55 pm, Frozzare <fredrik.for...@...> wrote:

> Hello.
>
> I don't get jquery localscroll target setting work right. I want to
> scroll the div's in #content div, but it's not working.
>
> my js code:
>
>         $(document).ready(function() {
>             $('ul.nav').localScroll({
>                 target: '#content',
>                 axis: 'xy',
>                 queue: true
>             });
>         });
>
> my html code:
>
> <div id="left" class="left">
>             <ul class="nav">
>                 <li><a href="#home">Hem</a></li>
>                 <li><a href="#about">Om mig</a></li>
>                 <li><a href="#work">Mitt arbete</a></li>
>                 <li><a href="#contact">Kontakt</a></li>
>             </ul>
> </div>
> <div id="content" class="page right">
>             <div id="home">
>                 <h3>
>                     Hem</h3>
>             </div>
>             <div id="about">
>                 <h3>
>                     Om mig</h3>
>             </div>
>             <div id="work">
>                 <h3>
>                     Mitt arbete</h3>
>             </div>
>             <div id="contact">
>                 <h3>
>                     Kontakt</h3>
>             </div>
> </div>