最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How can I detect Touchend or end of changing a range value? - Stack Overflow

programmeradmin1浏览0评论

I'm using AngularJS with Ionic Framework. I'm developing a live munication application.

I have a range slider ionic docu. If I use ng-change every step calls my callback, but I only want to transfer the end result. On desktop I can use ng-mouseup but I can't find a solution on mobile devices. Creating a delay is no solution for me because it must be fast.

I'm using AngularJS with Ionic Framework. I'm developing a live munication application.

I have a range slider ionic docu. If I use ng-change every step calls my callback, but I only want to transfer the end result. On desktop I can use ng-mouseup but I can't find a solution on mobile devices. Creating a delay is no solution for me because it must be fast.

Share asked Nov 5, 2014 at 17:25 mrmowmrmow 818 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

You can try to use the on-release event directive Ionic provides. The example below is untested, but should give you an idea.

http://ionicframework./docs/api/directive/onRelease/

Markup

<div class="range">
  <i class="icon ion-volume-low"></i>
  <input type="range" name="volume" ng-model="temp.volume" on-release="onRelease()">
  <i class="icon ion-volume-high"></i>
</div>

Controller

angular.module('App').controller(function ($scope) {
  $scope.onRelease = function () {
    $scope.volume = $scope.temp.volume;
  };
});
发布评论

评论列表(0)

  1. 暂无评论