0

This isn't entirely scientific, but if I set $.browser.safari = false in Safari or Chrome, then $.scrollTo no longer works on any element with any parameters. It doesn't throw an error or anything, but it certainly doesn't scroll.

I noticed this problem after following this advice: Distinguish Chrome from Safari using jQuery.browser

Community
  • 1
  • 1
curiouser
  • 970
  • 2
  • 12
  • 22
  • There's a big difference between `$.browser.safari = false` and `$.browser.safari == false`. The former assigns, the latter compares. – John Dvorak Nov 04 '12 at 21:20
  • `$.browser.safari` is meant to be read or compared, NOT set. When you set it, you run the risk of messing up other code that uses it. – jfriend00 Nov 04 '12 at 21:21
  • Can you point me to some reference on why not to set $.browser.safari? I only ask because there are code examples that use it and I can't seem to understand why not. – curiouser Nov 05 '12 at 03:59

1 Answers1

0

Don't set $.browser.safari = false in Safari/Chrome while using jQuery ScrollTo.

curiouser
  • 970
  • 2
  • 12
  • 22