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

Jumping to the top of the page #3

Open
LimeBlast opened this issue Dec 20, 2012 · 5 comments
Open

Jumping to the top of the page #3

LimeBlast opened this issue Dec 20, 2012 · 5 comments

Comments

@LimeBlast
Copy link
Contributor

I've been able to get the plugin working just fine when opening one of the folders, but upon closing a folder, the page automatically jumps to the top.

This is fine on sites like the RedFox media example, as the folders are at the top of the site, but on my site, the folders are about half way down the page, and as such, having the site jump to the top of the page is undesired.

Is there some way that I can avoid this happening?

Thank you

@spsaucier
Copy link
Owner

You can always change the link href="" value to "javascript:;".

On Thu, Dec 20, 2012 at 11:29 AM, Daniel Hollands
notifications@github.comwrote:

I've been able to get the plugin working just fine when opening one of the
folders, but upon closing a folder, the page automatically jumps to the top.

This is fine on sites like the RedFox mediahttp://redfoxmedia.net.au/toolbox/example, as the folders are at the top of the site, but on my site, the
folders are about half way down the page, and as such, having the site jump
to the top of the page is undesired.

Is there some way that I can avoid this happening?

Thank you


Reply to this email directly or view it on GitHubhttps://github.com//issues/3.

@LimeBlast
Copy link
Contributor Author

I'm not much good with jQuery, but I'm going to have a go at trying to find a better solution than that - I'm thinking that a simple return false in the right place might be enough.

@LINUXADDICT
Copy link

I second that request, this should be part of the official release.

@hanovin
Copy link

hanovin commented May 11, 2013

hello i have this problem to i tested Pull Request #5: commented out window.location.hash=""; but its not work
please help me to fix this problem

@boomstix
Copy link

boomstix commented Jun 4, 2013

replace line 117:

document.location.hash = '';

with:

if (window.history && window.history.pushState) {
    window.history.pushState('', '', window.location.pathname)
} else {
    window.location.href = window.location.href.replace(/#.*$/, '#');
}

JosephShenton pushed a commit to JosephShenton/iOSAppFolder9 that referenced this issue Feb 26, 2016
I'm no expect at jQuery (total n00b in fact), but it would seem
that the issue described here: spsaucier/App-Folders#3
is being caused by the `window.location.hash="";` line.

Upon removing it, the script stopped jumping back to the top.
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

5 participants