3

This will work in firefox but not in chrome although it will work in chrome if you remove jquery.

Demo: http://jsbin.com/eFUfILI/3/

Tareq Ibrahim
  • 359
  • 5
  • 16
  • 2
    Looks like jQuery 1.9.0 through 1.10.2 breaks that example in Chrome. 1.8.3 and 2.0+ work fine. Maybe someone will know what exactly in Webkit or jQuery 1.9-1.10 is breaking this. Not sure if this is stopping you from moving forward on something, but you could always try moving to 1.8.3, or 2.0+ if losing some IE compatibility isn't a big deal to you. – chucknelson Sep 04 '13 at 00:44
  • 1
    I thought I was going crazy - but I had this same issue tonight with JQM spent hours on it. THen I updated chrome and it went away - – imaginethepoet Sep 04 '13 at 04:34
  • 1
    What I have figured out is that animation is not failing but relative sizes are wrongly computed. Changing them to static values (e.g. `translateX(100%)` to `translateX(300px)`) fixes the bug. – Konrad Dzwinel Sep 04 '13 at 07:17
  • @imaginethepoet. Best to update your jQuery version, as you can't fix code by telling someone to upgrade their browser. Backwards compatibility is key! – Epiphany Sep 06 '13 at 08:06
  • I believe i might have been on a dev channel of chrome - not a release channel - that can have some impact. And believe it or not some people you need to tell to upgrade your browser :) You know who you are people running on 15 versions back firefox! – imaginethepoet Sep 06 '13 at 12:56

1 Answers1

0

If this was the scenario if faced, I would write up a browser sniffer first, and then dynamically load the right version of jQuery based on the properties of the browser the sniffer returned by running conditionals against an array of data you create specifiyng what browser (and not just Webkit by the way) is compatible with what version of jQuery.

I'm not going to code it all for you here, as that's a bit of work if you want it to work well... just compiling the data to use in your comparison array! You will also need to have an understanding of how browser sniffing works first. You can find more about that on SO at

Browser detection in JavaScript?.

I have used this approach very successfully over the years... especially in the days when IE was really unfreindly to us coders. This is really the only approach if you need to be both cross-platform AND backwards compatible.

You will also have the problem inherit within your own jQuery code as well, as there have been many, many, functions that have been either deprecated or replaced in a short time. As an example, the long used '.attr()' has been deprecated and replaced with '.prop()'.

Community
  • 1
  • 1
Epiphany
  • 1,678
  • 1
  • 18
  • 14