Say "No Scroll" to the Left Container
Posted by Stan Bogdanov on 11 January 2008 - 01:04Introduction
Very often we have a short reading text and many questions. For example, in a JQuiz generated exercise, when you click the "Show all questions" button, you have to scroll up and down to read the text, then scroll down to the question you are answering. It is even more so when you are watching a video. We can fix the position of the left container to not scroll along with the page.See a demo (click "Show all questions" and scroll up and down to see what happens).
Here's a small trick how to achieve this in two easy steps.
Step 1
Create your exercise as usual and open the .htm file in a Text or HTML Editor. Find this code (yours may not look exactly the same)div.LeftContainer{ font-family: Verdana,Geneva,Arial,sans-serif; font-size: 10pt; border-style: none; padding: 2px 0px 2px 0px; float: left; width: 49.8% margin-bottom: 0px; } |
Step 2
Add this line after (below) the margin declaration.position:fixed; /* This fixes the left container to not scroll*/ |
That's it. Save the file and view the result. The left container should stay fixed when you scroll up and down.
Rate this:Votes: 812 |
Share it: |



Write a comment
Posts: 1
Reply #2 on : Wed February 10, 2010, 14:06:25
Posts: 1
Reply #1 on : Sat February 06, 2010, 23:42:33