Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6696503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:20:57+00:00 2026-05-26T06:20:57+00:00

I see a strange issue where the ScrollTo plugin scrolls twice the expected distance,

  • 0

I see a strange issue where the ScrollTo plugin scrolls twice the expected distance, but only when you click on a radio button or checkbox label.

I removed the plugin and replaced it with this…

$("html, body").animate({ scrollTop: '+=50' }, 650);

Yet the issue remained. So then I tried adding an animation stop with no luck…

$("html, body").stop(true, true).animate({ scrollTop: '+=50' }, 650);

Then I created a very basic jsFiddle of the issue and I’m now convinced this is a jQuery Core bug. Tested in all jQuery versions back as far as jsFiddle allows. So far, it’s the same in Safari, Firefox and IE8.

If there’s a <label> element next to a radio button or checkbox and its id is used as the for attribute within the <label>, clicking the <label> will select its corresponding radio button or checkbox. (This is supposed to work like that.)

<input id="type-0" type="radio" name="name" value="" />
<label for="type-0" title="">Click this Label and Radio is selected.</label>

The issue here is that jQuery scrollTop() doubles the calculated position but only when you click on a <label> which selects a radio button or checkbox. It scrolls the proper distance when you click anything else including the radio button or checkbox itself.

http://jsfiddle.net/sparky672/sZAkJ/

As you can see, clicking the label linked to its input element causes a double scroll.

Some other observations:

In my page, it appeared as if the scroll starts and stops twice. That’s why I added the .stop(true, true) to my animation. However that has no effect towards stopping this problem.

I cannot avoid using the labels to select my input elements since I have another feature that depends upon this. (Example: http://jsfiddle.net/sparky672/CgMX8/)

I’m looking for…

1) An explanation for this. If not, perhaps it’s just a (new?) jQuery Core bug. I was unable to find any other mention of this quirk after searching Google. Nothing in the jQuery bug tracker either.

2) A workaround for this so I can click on input labels and not have the scroll doubled. I’d like to achieve the scroll effect when anything within the container is clicked including the radio buttons & labels. I’m thinking that the selectors can be refined so the scroll can be cut in half when a label is clicked but still work normally when anything else is clicked. (That may not work very well either since it still appears as if the animation is fired twice.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:20:57+00:00Added an answer on May 26, 2026 at 6:20 am

    1) An explanation for this. If not, perhaps it’s just a (new?) jQuery Core bug. I was unable to find any other mention of this quirk after searching Google. Nothing in the jQuery bug tracker either.

    This isn’t an issue with scrollTop or animation. It has to do with the click event being handled twice on #wrapper when the label is clicked.

    When the label is clicked, a click event bubbles up to #wrapper. However, clicking the label also triggers a click event on the input it’s tied to, which also bubbles up to #wrapper.

    For proof of this, check out this example: http://jsfiddle.net/g9gAT/. Each time the click event is handled, I’m appending the tag name of the target element. When you click a label it’s appends label followed by input.

    2) A workaround for this so I can click on input labels and not have the scroll doubled.

    $("#wrapper label").click(function (e) {
        e.stopPropagation();
    });
    

    Update Example: http://jsfiddle.net/r3fX4/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this strange issue with my web app. You see, I'm using jQuery
I have a strange issue: I am using SPContext.Current.Web in a .aspx page, but
I have some strange issue using jQuery Validation plugin. Firs of all here is
I'm experiencing a very strange issue where I cannot see a Custom WPF control
I'm having a strange issue that I think I have a workaround for, but
Disclaimer : this is a strange issue that only happens in a Kindle Fire
Recently, I encountered a very strange issue, this issue only happens in Windows XP
When using Rails date_select with :prompt => true I see some very strange behavior
Today I was walking at the MSDN Forums and I see two very strange
I have a strange (don't ask) need to see a few examples of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.