Hello,
I’m trying to sticky the text of a question stem so that it follows you while you scroll. I’m pretty new to HTML and Javascript, so I’m not entirely sure how to do it.
I’ve tried using the solution presented in this thread, but it’s giving me the error message "Invalid JavaScript! You cannot save until you fix all errors: Unexpected token ILLEGAL". I’m not sure what’s causing it, but I tried putting the '); on the same line as ('afterbegin', '. That got rid of the error, but then the code then didn’t seem to be doing anything.
I also tried using custom CSS to accomplish it. This is the code I’m using:
div.sticky {
position: -webkit-sticky;
position: sticky;
top: 0px;
background-color: blue;
}
I put <div class=”sticky”> </div> around the question in the HTML editor, and I used the background color to confirm that it was linked properly, but the rest of the CSS doesn’t seem to be working.
I’d really appreciate any help with getting this to work. Thank you!