New function for setting the layer of the scroll spy.