Forum How do I...?

sliding sidebar from top to down

fassungsvergleich
Hello,

I am working on a pdf for legal documents and we want to implement a "sliding sidebar".

At the moment the sidebar with @right-middle for every chapter is at the top position (looks like screenshot), but the position of the sidebar should be changed for every chapter.
chapter2.png


css code for this element:
    @right-middle {
        content: string(abb);
        color: white;
        text-align: right;
        background-color: #000000;
        margin-left: 0.2cm;
        padding-right: 0.2cm;
        margin-top:  0cm;
        margin-bottom: 25cm;
        font-size: 10pt;
    }



In chapter 3 the sidebar should slide down one step, but at the moment it is at the same position as in chapter 2. It should looks like chapter3.png
chapter3.png



Is there any way to calculate the margin-top and margin-bottom values eg. with javascript?
Are there any other ways to implement such a sidebar which slides from top to down.
  1. chapter2.png179.9 kB
    Sidebar for chapter2
  2. chapter3.png102.8 kB
    Sidebar for chapter3
mikeday
Tricky, it looks like this will need a separate @page rule for each chapter at the moment. You could generate all the CSS with JavaScript, yes.