How to make a Vertical Parallax background 2D?


I am making a “Doodle Jump”-like platformer game where the character is jumping upwards and if it takes a powerup the speed of the jump is faster.

My question

How can i make the top edge of the camera detect that there is an empty space (no background) and generate the new parallax background and the old background to be destroyed?

The player should see that it is an infinite parallax background without affecting the gameplay. I don’t want it to be a loopable scrolling because when the character is staying on the platform not moving upwards the background should not move also.

You can move the background based on player movement. Just have three backgrounds stacked on one another and move the bottom one to the top when the player has moved a particular distance from the background.
This tutorial might help.