Skip to content
CSS get/set and animate background position values independently
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
README.md
jquery.backgroundPosition.js
jquery.backgroundPosition.min.js

README.md

With the plugin you can get/set and animate background position CSS values independently.

Get the CSS background positions's X component

$(elem).css('background-position-x');

Set the CSS background positions's Y component

$(elem).css('background-position-y', 0);

Animate the background positions X and Y component

$(elem).animate({
  backgroundPositionY: '100%',
  backgroundPositionX: '100%'
}, 1000);

Requires jQuery 1.4.3+.

Something went wrong with that request. Please try again.