spsaucier / App-Folders

Use jQuery to create iOS-like App Folders on any website. They can contain any content and be styled in any way
143 stars 34 forks source link

Jumping to the top of the page #3

Open LimeBlast opened 11 years ago

LimeBlast commented 11 years ago

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 commented 11 years ago

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/spsaucier/App-Folders/issues/3.

LimeBlast commented 11 years ago

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 commented 11 years ago

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

hanovin commented 11 years ago

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 commented 11 years ago

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(/#.*$/, '#');
}