Jump to content

Manipulating Background Position.


Recommended Posts

var a =  document.getElementById('mydiv').style.BackgroundPosition;

returns "10px 20px", probably a string. so, how to get x and y values for two variables ?like var x = x-position(10) var y = y-position(20)as integers to manipulate with ??a little function to extract and assign the two integer values to my choice of variables ??

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...