Well I don't know how you are moving your background. I'm not really sure how your working with your layout. Do you have a very large wide layout. or is in a single layout size equal to viewport and your just moving your background objects.
However if you want to link the speed of motion to the background you could do a translation of distance from center to speed ratio.
background animation speed = distance(enemy, viewport center) * X
so if your enemy is dead center the animation stops.
if you have a very large wide layout. I'll think about it some more.