语言

Menu
Sites
Language
swipe event on scrollview element

Hello.

How to detect swipe event on zoomed out scrollview element?

For example, swipe on #my-element div:

<div class="ui-scrollview-clip" id="my-element" data-scroll="xy" style="width: 300px; height: 600px;">
    <div class="ui-scrollview-view" style="width: 300px; height: 600px; -webkit-transform: translate3d(0px, 0px, 0px); -webkit-transition: none; ">
		<img src="file:///opt/usr/media/Downloads/image100.jpg" style="width: 300px; height: 200px;">
	</div>
</div>

 

响应

2 回复
Alexander AVSukhov

Hello,

For the swipe events you can bind the "swipeleft" and "swiperight" events to a .on() function in jQuery Mobile.

Marco Buettner

For swipe use

$('#my-element').on("swiperight", function() {//TODO: DO SOMEHTING});

or

$('#my-element').on("swipeleft", function() {//TODO: DO SOMEHTING});