So here is my temporary solution - until someone comes up with something better:
1. Set scrolling() function as onscroll attribute in scrollarea layer
|
Quellcode
|
1
2
3
4
5
6
|
<layer name="scrollarea"
type="scrollarea"
...
onscroll="scrolling()"
...
</layer>
|
2. Copy millisecond "timestamp" into variable last_scroll on every scroll movement in the scrolling() function
|
Quellcode
|
1
2
3
|
<action name="scrolling">
set(last_scroll, *timertick);
</action>
|
3. Replace link in the text with onclick="open_link(
http://foo.bar)" in the scrollarea text.
Whenever the "link" is touched this function compares the current timestamp to the timestamp of the last onscroll trigger and opens the link if the diffrence is greater than 2. This means that it could not have been touched unintenionally while scrolling as the diffrence would be 0 than.
|
Quellcode
|
1
2
3
4
|
<action name="open_link">
calc(scroll_div, timertick - last_scroll);
if (scroll_div GT 2, openurl(%1));
</action>
|
If anyone (especially Klaus) has a better solution please let me know!