Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrollPosition: transform in Safari doesn't work #139

Open
DotCoyote opened this issue Mar 3, 2016 · 0 comments
Open

scrollPosition: transform in Safari doesn't work #139

DotCoyote opened this issue Mar 3, 2016 · 0 comments

Comments

@DotCoyote
Copy link

Hi,

I experienced, that stellar doesn't work in Safari-Browsers, when scrollProperty is set to transform. This is due to the fact, that Safari returns numbers with up to ~ 20 decimals for matrix-values via getComputedStyle.

I rewrote the getLeft-Function a little, to fix that:

Line 45:

getLeft: function($elem) {
  var computedTransform = getComputedStyle($elem[0])[prefixedTransform];
  if(computedTransform !== 'none') {
    var modified = computedTransform.replace(/^\w+\(/,"[").replace(/\)$/,"]");
    var array = JSON.parse(modified);
  }
  return (computedTransform !== 'none' ? array[4] * -1 : 0);
},

I don't know, if the problem exists with getTop() as well, but you can adapt the function there, i think.

Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant