Making a course block 'frozen' so it scrolls when the user does

Re: Making a course block 'frozen' so it scrolls when the user does

by Brian Merritt -
Number of replies: 0
Picture of Particularly helpful Moodlers
Hi Catherine

In general, just using css is hard to do and the results are unlikely to be what you want. For example, the item would cover other content.

There is a brief tutorial here which explains how to (not in Moodle, sorry) create an element that scrolls normally but never goes off the page by switching the class name as the item would start scrolling off the page to a fixed element.

https://css-tricks.com/scroll-fix-content/

Having said that I also saw this Bootstrap 4 based trick that "might" work.

https://stackoverflow.com/questions/28340054/bootstrap-keep-div-fixed-after-scrolling-to-it

div class="card sticky-top"
       Your content here 
div/ 

The above would be theme dependent and of course you need to edit in raw mode and add the angled brackets which I can't add here without making them real html.