Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Smooth ScrollTo prevents bootstrap slideshows to work properly.
Comment | File | Size | Author |
---|---|---|---|
#1 | bootstrap-2153689-1-aggressive_scroll.patch | 562 bytes | Simon Georges |
Comments
Comment #1
Simon Georges CreditAttribution: Simon Georges commentedAll credits for this patch goes to Grsmto.
Comment #2
Simon Georges CreditAttribution: Simon Georges commented(It seems to prevent linking to another page with an anchor as well, see for example permalinks on node comments).
Comment #3
AvO WebWorks CreditAttribution: AvO WebWorks commentedThe patch above works wonderfully thank you.
Comment #4
Simon Georges CreditAttribution: Simon Georges commentedComment #5
JadH CreditAttribution: JadH commentedPatch worked for me also
Comment #6
markhalliwellThanks @simongeorges!
Committed 638f919 to 7.x-3.x:
Comment #7
markhalliwellComment #9
dagomar CreditAttribution: dagomar commentedCould someone explain why we need that functionality in the first place? It doesn't seem to be part of bootstrap to begin with, and it interferes with all links to anchors, also the ones that some modules, like the media field, rely on.
Comment #10
markhalliwellWhen a fixed navbar or some sort of fixed menu (admin_menu) is present, it overlays the actual position of the anchor clicked. It's a simple setting that can be disabled if it's really "interferes" with your design.
Comment #11
dagomar CreditAttribution: dagomar commentedHi Mark,
thanks so much for yor reply! I completely overlooked that it's possible to turn that feature off. However, if I or anyone else wants to use it, perhaps there should be a way to influence the selector?
Thanks again,
Dagomar
Comment #13
markhalliwellI'm just moving this back to 7.x. If this needs re-evaluation in 8.x, create a new issue.
Comment #14
kopeboy CreditAttribution: kopeboy commentedI am sorry to reopen this but I cannot use the feature at all with anchor links. Anchor links work only if I disable "Fix anchor position", but disabling that hides the scrolling functionality as well. So what is the rationale of this feature at all? I don't get it.
What is the problem causing anchor links not to work when "Fix anchor position" is enabled?
Using fresh install site with latest core, jquery 10 (with jquery update) and anchor links in a menu with #anchor and anchors either with name or ids.
Everything works properly when I disable the feature but of course I would like the smooth scrolling functionality. I tried other modules for that too but no one seems to work :(
Comment #15
kopeboy CreditAttribution: kopeboy commentedComment #16
donquixote CreditAttribution: donquixote commentedThis caused some confusion with Gallery formatter:
#2274693: Undesired scrolling, if used in combination with Bootstrap theme.
I think the problem is that the "fix" is only meant for anchors that work as regular links, but it also affects anchor links that already have a click behavior attached, and where the regular link action is suppressed.
Yes, it can be turned off. But it would be preferable to find a solution that only affects the links we actually care about.
Or otherwise make this opt-in.
Comment #17
Konstantin Komelin CreditAttribution: Konstantin Komelin commentedThe anchorBehvior should probably compare url paths and not only anchors #2343539: bootstrapAnchor does not check if URLs are different
Comment #18
ChrisSnyderScrollTo is a little aggressive, in order to prevent issues with jquery ui date popup i had to change the following:
Comment #19
klokie CreditAttribution: klokie commentedI just ran into this issue as well. Seems to me that the jQuery selector that matches the URL fragment should be
a[href^="#"]
– i.e. URL starts with a hash mark – rather thana[href*="#"]
– i.e. URL contains a hash mark at any position. That should prevent this unwanted behavior on links to other pages (and may also help with #2343539: bootstrapAnchor does not check if URLs are different), though it probably won't fix the conflicts with other modules like Gallery formatter or Date.Comment #21
markhalliwellClosing in favor of #2462645: Create @BootstrapPlugin for "bootstrap-anchor".
Marking as "won't fix", because any solution(s) provided here is against the current code. This will be replaced with http://markcarver.github.io/bootstrap-anchor/ instead.