Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Its just not working... #62

Closed
lancevjm opened this issue Jan 20, 2014 · 8 comments
Closed

Its just not working... #62

lancevjm opened this issue Jan 20, 2014 · 8 comments

Comments

@lancevjm
Copy link

ok, so I'm a bit new to jquery and found your plugin totally awesome! but I cannot get it to work, I've been through all the topics posted in issues and the documentation and tried literally all the suggestions made to other but still cannot get it to work. Help please?

The mark up:

Welcome to My company this is the company where you will be in a company

We focus on being the top company of compies especially when companies are likea real company.

More so we also provide companies with things that companies need, like people to be in the company.

the js

jQuery(document).ready(function($) {

$('#nav').localScroll({
    target:'#content_wrap', // Could be a selector or a jQuery object too.
    axis:'x',
    queue:true,
    duration:1500
});

});

@tmorehouse
Copy link

I think you can leave out the target, since you are binding localscroll to your #nav container (i.e. the elements that will cause the scroll), assuming you want to scroll the whole document (unless your #content_wrap is a container that has scrolling enabled and a set height)

$('#nav').localScroll({
    axis:'x',
    queue:true,
    duration:1500
});

@lancevjm
Copy link
Author

OK maybe I left out some info. Sorry bout that. There are a few links which should scroll the relative hash section which is inside the target. Would that be correct? I have tried leaving the target out and it didn't work. Many elements are floated, I don't know if that could cause a problem, read something about that in another issue, but was dated back quite some time. What do you mean by 'has scrolling enabled? Maybe I'm missing that?

@flesler
Copy link
Owner

flesler commented Jan 20, 2014

@tmorehouse thanks a lot for replying to people 👍
@lancevjm It'd be much easier if you can put what you're working on online, you can email me privately if it's a problem. It's a lot hard to resolve issues like this.

@lancevjm
Copy link
Author

ok, so heres some dummy data: http://www.testing.fevafinda.co.za/ i would like the different sections to scroll. I am using codeigniter, I dont think that should be a problem tho.

Thanks alot guys.

@tmorehouse
Copy link

Looking at the structure of your page, it is not the div#content_wrap that is scrolling, but the whole page.

Your script show you targeting section elements.

jQuery(document).ready(function($) {
    $('#nav').localScroll({
         target:'section', // Could be a selector or a jQuery object too.
         axis:'x',
         queue:true,
         duration:1500
    });
});

you also have this in your CSS:

body, html {
    height: 100%;
    overflow: auto;
}

Remove the height: 100% and overflow: auto. This will reset your document back to normal scrolling.

and change your code to the following:

jQuery(document).ready(function($) {
    $('#nav').localScroll({
        duration:1500
    });
});

And see if that works.

@lancevjm
Copy link
Author

aaaaahhh... works like a bomb! When I grow up I wanna be like you @tmorehouse Thanks so much for the help guys!

@flesler
Copy link
Owner

flesler commented Jan 24, 2014

Thanks @tmorehouse for the help

@tmorehouse
Copy link

No problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants