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

JS Fix for animations in Internet Explorer #1

Open
ocorral opened this issue Aug 31, 2012 · 1 comment
Open

JS Fix for animations in Internet Explorer #1

ocorral opened this issue Aug 31, 2012 · 1 comment
Assignees

Comments

@ocorral
Copy link

ocorral commented Aug 31, 2012

IE doesn’t know what background-position is, it only knows 2 other calls: background-position-x and background-position-y. Here is a function to handle this problem.

(function($) {
  jQuery.fn.backgroundPosition = function() {
    var p = $(this).css('background-position');
    if(typeof(p) === 'undefined') return $(this).css('background-position-x') + ' ' + $(this).css('background-position-y');
    else return p;
  };
})(jQuery);

Also be sure to replace line 82 and 125 from:

var backgroundPos = $(this_parent).css('background-position').split(" ");

To:

var backgroundPos = $(this_parent).backgroundPosition().split(" ");
@apolinario
Copy link
Owner

Thank you very much, I'm gonna fix this asap and soon launch the new version with this issue fixed!

@ghost ghost assigned apolinario Jan 6, 2013
apolinario pushed a commit that referenced this issue Nov 30, 2014
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

2 participants