Add A Scrollbar

From Frontal Wiki

Jump to: navigation, search

Let's add a scrollbar to a text tag. We can do this by simply adding "scroll: auto;" to the style declarations for text nodes in our style sheet:

text
    {
        color: blue;
        text-align: justify;
        font-family: Times Roman;
        font-size: 11px;
        condense-white: true;
        scroll: auto;
    }

Then, to trigger the display of the scrollbar, we need to limit the height of the text block. In this case, we do that by applying a style directly to the text tag:

<text style="width: 180px; height: 120px;">

Don't like the way the scrollbar looks? Don't worry, it's fully customizable right in the Frontal document -- including adding and removing interface elements like scroll buttons, as well as adding rollover and active states. Check out Scrollbars for more details.

Here's how the code looks all together (click the run button below it to see how it works):

<style><![CDATA[
    text
        {
            color: blue;
            text-align: justify;
            font-family: Times Roman;
            font-size: 11px;
            condense-white: true;
            scroll: auto;
        }
]]></style>
<text style="width: 180px;height: 120px;"><![CDATA[
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<li>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</li>
<li>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</li>
]]></text>
Personal tools
Get Adobe Flash player