JangoSteve / jQuery-EasyTabs

Easy and flexible jQuery tabbed functionality without all the styling.
http://www.alfajango.com/blog/jquery-easytabs-plugin/
549 stars 203 forks source link

Chrome 39 scrolls to tab anchor on click #205

Open ken487 opened 9 years ago

ken487 commented 9 years ago

In chrome 39 on Xubuntu the browser scrolls the page to the tab anchor (eg, #tab-1) when you click it. It did't do that in chrome 32 or any other browser I tested it in.

ahendri commented 9 years ago

This hash jump problem does also occur in other browsers. There are solutions to fix it, but most are complicated, blow up the code and might cause side-effects. Instead I proposed a patch to use the modern history API for browsers that support it and to only fallback to manipulation the location directly. See: https://github.com/JangoSteve/jQuery-EasyTabs/pull/203

chtef commented 9 years ago

Hello ahendri, just want to mention that the fix doesn't seem to work with the latest Chrome version (39). It actually makes the browser jump around even more when I click on tabs. Any suggestion? Thanks.

chtef commented 9 years ago

Nevermind - my bad. I didn't port your code properly. It seems to work now - thanks.

pascalBokBok commented 9 years ago

@JangoSteve will there be a release with this fix?

pathetix commented 9 years ago

@ahendri Thanks for the pushState fix. Hopefully this will be merged in the main branch :+1:

tD3rk commented 9 years ago

This fix works well for when a tab is clicked, however it does not apply to page load of a link. So if you were to click a link to http://website.com/page#tab2 the previous undesirable behavior would still be in effect.

mvdepot commented 9 years ago

The fix did not change the jump issue in chrome 39 when using ajax. <li class="tab"><a href="ajax1.txt" data-target="#tabs-ajax-html">tab1</A></LI>

ahendri commented 9 years ago

Agreed that this does not fix all issues, but at least for me it would still be an improvement.

I like the simplicity of the project and would like to continue using it, but not being sure if it is still under active leadership I am a little reluctant to spend too much time on proposing more fixes.

Craigy- commented 9 years ago

EasyTabs doesn't work properly wtih this fix if page has <base> tag... At least on webkit.

Craigy- commented 9 years ago

ahendri, I answered you on the commit's page

Craigy- commented 9 years ago

ahendri, your fix has helped. I think it's necessary to commit.

Craigy- commented 9 years ago

So, would you make a new commit?

ahendri commented 9 years ago

I am actually not really feeling comfortable pushing this as I wasn't able to test give it a try at least in all the common browsers. Still I will make a change request now and hope for comments if something does not work out allright

SimonVerboven commented 8 years ago

We are actually using easytabs on a project and are experiencing the same issue on Chrome 46.x .. just before I updated, I was on Chrome 45.x and there weren't any issues on that version. Seems pretty odd as I wouldn't expect any major code changes to have happened to cause this.

Is there a fix for this or not really?

melcak commented 8 years ago

+1

Aleserche commented 8 years ago

+1

jmp909 commented 8 years ago

I think it might be related to this. https://github.com/JangoSteve/jQuery-EasyTabs/pull/203#issuecomment-181872410

My browser was jumping to somewhere it shouldn't be, because it's trying to be helpful and show you the content , which of course is not what we need it to do and actually was doing it incorrectly.

Could be a separate issue though, but it's definitely a recent browser change as I wasn't having issues with easytabs on my site until recently

The shim fix works for me, but again my problem is slightly different.