In this element’s style, I want to add coords-x
and coords-y
. I will be using position: absolute
. I could only figure out how to get coords-x
in there. How can I add coords-y
in there at the same time?
style={{{ [<event>get[coords-x]addprefix[left: ]addsuffix[px;]] }}}
/* is there a way to also add [<event>get[coords-y]addprefix[top: ]addsuffix[px;]]
Above is the line I was focused on,
below is the full code just in case it helps:
\define scroll(msg)
/* uses <$trigger> macro, executes <$action> widget on tiddler load. */
<$action-sendmessage $message="tm-scroll" $name="selector" $value={{{ [<storyTiddler>get[tiddler-id]addprefix[#]] }}} animationDuration="0"/>
\end
<$scrollable class='tta-timeline'>
<$list filter="[tag[$:/TTA/Year]]" variable="year">
<div class="tta-timeline-year-container" style={{{ [<year>get[width]addprefix[width: ]addsuffix[px]] }}}>
<span class="tta-timeline-year-caption">
<$text text={{{ [<year>get[caption]] }}}/>
</span>
<div class="reset">
<$list filter="[tag<year>nsort[order-inUniverse]]" variable="event">
<div id={{{ [<event>get[tiddler-id]] }}} class="tta-timeline-event-container" style={{{ [<event>get[coords-x]addprefix[left: calc( ]addsuffix[px - 50% + 15px);]] }}}>
<div class="tta-timeline-event-icon">
<$link to={{{ [<event>get[title]] }}}/>
</div>
</div>
</$list>
</div>
</div>
</$list>
<$trigger actions=<<scroll>>/>
</$scrollable>