Hello everyone.
I'm using a small script to scroll some text. The triggers are in two arrow-images.
The original script uses onMouseOver and onMouseOut. Hence touchscreens ignore these (don't function right, the text keeps on scrolling) I added onTouchStart and onTouchEnd, but simply adding these eventhandlers won't do the trick.
I found a clue but I don't know how to properly integrate it in one piece of well written code.
original:
changed it into:Code:<img src="../images/btn_arrowup_orange.png" class="scrollbar-up" id="arrowup" onmouseover="scroller.startScroll(0, 5);" onmouseout="scroller.stopScroll();" /> <img src="../images/btn_arrowdown_orange.png" class="scrollbar-down" id="arrowdown" onmouseover="scroller.startScroll(0, -5);" onmouseout="scroller.stopScroll();" />
Code:<img src="../images/btn_arrowup_orange.png" class="scrollbar-up" id="arrowup" onTouchStart="scroller.startScroll(0, 5);" onMouseOver="scroller.startScroll(0, 5);" onMouseOut="scroller.stopScroll();" onTouchEnd="scroller.stopScroll();" /> <img src="../images/btn_arrowdown_orange.png" class="scrollbar-down" id="arrowdown" onTouchStart="scroller.startScroll(0, -5);" onMouseOver="scroller.startScroll(0, -5);" onMouseOut="scroller.stopScroll();" onTouchEnd="scroller.stopScroll();" />
see link:
http://bertienvanmanen.nl/pages/cv.html#
and the clue might be:
Code:element.onmousedown = function (e) { document.onmouse = etc. document.onmouseup = etc. } element.ontouchstart = funtion (e) { element.onmousedown = null; document.ontouchmove = etc. document.ontouchend = etc. }



Reply With Quote

Bookmarks