onsen-ui gestures not working -
i need implement menu exact same looks onsen sliding-menu,but slides top. thinking use onsen gestures able drag menu, gestures sample provided in onsen guide not work. missing something?
<ons-gesture-detector> <div id="detect-area" style="width: 300px; height: 300px;background-color:blue;"> swipe here </div> </ons-gesture-detector> <script> alert("in"); $(document).on('swipeleft', '#detect-area', function() { alert("swipe"); }) </script>
try this, should work. don't forget add jquery first.
<ons-gesture-detector style="height: 300px; margin: 50px 50px;"> <div id="hoge" style="border: 1px solid #ccc; background-color: #f9f9f9; width: 100%; height: 300px; line-height: 300px; text-align: center; color: #999;"> ... </div> </ons-gesture-detector>
<script> var eventname = 'drag dragleft dragright dragup dragdown hold release swipe swipeleft swiperight ' + 'swipeup swipedown tap doubletap touch transform pinch pinchin pinchout rotate'; $(document).on(eventname, '#hoge', function(event) { if (event.type !== 'release') { $(this).text(event.type); } }); </script>
Comments
Post a Comment