I am making a sticky header that works on a touch screen, using hammer.js for touch gestures:
scrollEvent: function () {
Hammer('.desktop', {
drag_block_horizontal: true,
drag_lock_to_axis: true,
release: false
}).on("drag", function (event) {
$('#steg1').css({ position: "fixed" });
});
},
HTML:
<div class="desktop" id="desk1">
<ul>
<li>
<strong id="steg1">Steg1</strong>
</li>
<li>
<strong>Steg2</strong>
</li>
</ul>
</div>
The header remains sticky while dragging on the screen, the problem is the header disapears when the finger is released from the screen and swipe scrolling the page, then the header apears again after the scrolling is stopped. (This is only tested on iphone 4s/5).
So the function only understands the drag performance but not when the finger is released from the screen, any help is appreciated!