Changing elements to move with scroll
There are certain parts of the website I'm optimizing that stay stationary despite scrolling (i.e. this part follows the viewer as they scroll down and it only dissapears when it moves behind other elements that move up when you scroll down.
I want to make another element do the same thing (right now this element moves up like normal when you scroll down the website. I want this element to stay staionary and follow the viewer as they scroll down and then move behind other objects.
Thanks for any help in advance!
One of the common ways of doing this would be to modify the CSS. To do so set the "position: fixed;"(this should ensure the element does not move) and set the z-index value to a negative number (this will make sure the element does is not covered by other elements).
To do so within Optimizely:
- Click on the element that you want to make static
- Select "Edit Style"
- Click to "Show Advanced" to display the advanced options
- Under the "Layout Tab" change the Display property to Block and Z-Index to some negative number for e.g -999
- Hit Done !
Let me know if that works !