I\'m using this code...
document.getElementById(\'a1\').style.backgroundPosition = \'0px 0px\';
and it works fine but is there anyway to
Since the background position is a string, you can just concatenate your value in.
For example:
var yValue = 20; document.getElementById('a1').style.backgroundPosition = '0px ' + yValue + 'px';
var bgPos = '20px'; document.getElementById('a1').style.backgroundPosition = '0px ' + bgPos;