Bug Tracker

Opened 5 years ago

Closed 5 years ago

#14870 closed bug (notabug)

Animate scrollTop Fails in Chrome

Reported by: lage.michael@… Owned by: lage.michael@…
Priority: undecided Milestone: None
Component: unfiled Version: 1.11.0-rc1
Keywords: Cc:
Blocked by: Blocking:

Description

jQuery versions tried: 1.11.0 & 2.0.3 My project requires 1.x for IE8 support

Browsers affected: Chrome, Opera, Safari, IE11 Works in: Firefox, IE8, IE9, IE10

OS's Tested on: MacOS (Chrome, Opera, Safari, Firefox), Windows XP (IE8), Win 7 (IE9, IE10, IE11)

I have an "a" element in my DOM with the id, say-hello. The intended affect is for when the user clicks it, the page scrolls down to the form for contacting us.

<script type="text/javascript">
  $(document).ready(function(){

    $('#say-hello').on('click', function(e){
      e.preventDefault();

      $('html, body').animate({
        scrollTop: $("#contact-us h2").offset().top
      }, 1000);

    });
  });
</script>

It works perfectly in firefox and the lower versions of IE. Perhaps it's related to webkit, but then again, it's not working IE11. In the head of the DOM, I have the following meta tag:

<meta http-equiv="X-UA-Compatible" content="IE=edge">

That made it work in IE8, while fixing the overall look of the site.

I have been using jQuery for a year now and haven't had issues with scrollTo in the animate function. Not sure if this is a recent webkit update that has broken it.

Change History (3)

comment:1 Changed 5 years ago by timmywil

Owner: set to lage.michael@…
Status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the "jQuery(edge)" version to ensure the issue still exists—you may need to change this to a specific version depending on the test case.

To get you started, use the appropriate boilerplate:

Open the link and click to "Fork" (in the top menu) to begin.

Also, please read:

Additional resources:

comment:2 Changed 5 years ago by anonymous

I realized I had some conflicting CSS. Sorry for the false bug report!

comment:3 Changed 5 years ago by timmywil

Resolution: notabug
Status: pendingclosed
Note: See TracTickets for help on using tickets.