Welcome to the DFO World Wiki. With many major updates since the release of DFO, many items are missing. Visit Item Database Project to learn more.
Please remember to click "show preview" before saving the page.
Thanks for the updated logo snafuPop!

Difference between revisions of "Template:Horizontal scale"

From DFO World Wiki
Jump to: navigation, search
(Created page with "<noinclude>{{documentation}}</noinclude><includeonly>{{#ifeq:{{#expr:{{{increment}}}*0}}|0|{{#ifexpr: {{Horizontal scale/Current number|from={{{from}}}|to={{{to}}}|increment=...")
 
(changed increment variable name)
Line 1: Line 1:
<noinclude>{{documentation}}</noinclude><includeonly>{{#ifeq:{{#expr:{{{increment}}}*0}}|0|{{#ifexpr:
+
<noinclude>{{documentation}}</noinclude><includeonly>{{#ifeq:{{#expr:{{{incrmnt}}}*0}}|0|{{#ifexpr:
  {{Horizontal scale/Current number|from={{{from}}}|to={{{to}}}|increment={{{increment}}}|loop={{{loop}}} }}
+
  {{Horizontal scale/Current number|from={{{from}}}|to={{{to}}}|incrmnt={{{incrmnt}}}|loop={{{loop}}} }}
  <= {{{to}}} - {{{increment}}}|<!-- Print all but last label in this fashion:
+
  <= {{{to}}} - {{{incrmnt}}}|<!-- Print all but last label in this fashion:
 
.if so, then--><div style="float:left; overflow:visible; width:{{#expr:  
 
.if so, then--><div style="float:left; overflow:visible; width:{{#expr:  
 
(
 
(
   <!--25*increment / (Largest number to print - smallest number to print), giving room for 3 ticks in between-->
+
   <!--25*incrmnt / (Largest number to print - smallest number to print), giving room for 3 ticks in between-->
  
   99.100 <!--IE can't handle 100-->  *  {{{increment}}}
+
   99.100 <!--IE can't handle 100-->  *  {{{incrmnt}}}
 
   /  
 
   /  
 
   (
 
   (
Line 14: Line 14:
 
   )
 
   )
 
)
 
)
}}%;">{{!}}<div name=Number style="font-size:86%; position:relative; left:-1.8em; width:3.6em; overflow:visible; text-align:center">{{Horizontal scale/Current number|from={{{from}}}|to={{{to}}}|increment={{{increment}}}|loop={{{loop}}} }}</div></div>|<!--
+
}}%;">{{!}}<div name=Number style="font-size:86%; position:relative; left:-1.8em; width:3.6em; overflow:visible; text-align:center">{{Horizontal scale/Current number|from={{{from}}}|to={{{to}}}|incrmnt={{{incrmnt}}}|loop={{{loop}}} }}</div></div>|<!--
 
.else-->{{#ifexpr:
 
.else-->{{#ifexpr:
  {{Horizontal scale/Current number|from={{{from}}}|to={{{to}}}|increment={{{increment}}}|loop={{{loop}}} }}
+
  {{Horizontal scale/Current number|from={{{from}}}|to={{{to}}}|incrmnt={{{incrmnt}}}|loop={{{loop}}} }}
 
  <= {{{to}}}|<!--
 
  <= {{{to}}}|<!--
.Last tick only --><div style="float:left; overflow:visible; width:0;">{{!}}<div name=Number style="font-size:86%; position:relative; left:-2em; width:4em; text-align:center">{{Horizontal scale/Current number|from={{{from}}}|to={{{to}}}|increment={{{increment}}}|loop={{{loop}}} }}</div></div>}}
+
.Last tick only --><div style="float:left; overflow:visible; width:0;">{{!}}<div name=Number style="font-size:86%; position:relative; left:-2em; width:4em; text-align:center">{{Horizontal scale/Current number|from={{{from}}}|to={{{to}}}|incrmnt={{{incrmnt}}}|loop={{{loop}}} }}</div></div>}}
}}|<br>Please delete the line <code>increment=</code>. It's preventing the template from working.}}</includeonly>
+
}}|<br>Please delete the line <code>incrmnt=</code>. It's preventing the template from working.}}</includeonly>

Revision as of 09:20, 15 August 2018

Template Documentation view

As used in {{Horizontal timeline}}.

Example

{{Horizontal scale
 |from=1
 |to=100
 |increment=1
 |loop=5
}}

produces

|
6