Created a slider example below. It is necessary to cut values ​​from 200,000 to 250,000. When I slide a slider, it should show 250,000 after 200,000.

In other words, valid range values ​​should be from 90,000 to 200,000 and from 250,000 to 400,000.

It is necessary to exclude the possibility of choosing a slider range from 200 000 to 250 000.

Thank you for your time.

var myApp = angular.module("myApp", []); myApp.controller("SomeController", function($scope) { $scope.transv_frq = 0; }); 
 <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> <div ng-app="myApp"> <div ng-controller="SomeController"> Частота передачи: {{transv_frq}} Гц <div> <input type="range" id="TransiveFrequency" ng-model="transv_frq" value="transv_frq" min="90000" max="400000" step="25"> </div> </div> </div> 

  • At least suggest an idea. I will do it myself. - NewSheriff
  • To suggest an idea you need to understand what you need. You have described the situation, it is wonderful what exactly you can’t do? What is the question? - Dimanoid
  • It is necessary to exclude the possibility of choosing a range from 200,000 to 250,000 by the slider. - NewSheriff

1 answer 1

So I nakidal presumable option.

But I do not like it, as the slider jumps. It is necessary that there is no jump.

 var myApp = angular.module("myApp", []); myApp.controller("SomeController", function($scope) { $scope.transv_frq = 0; $scope.ChangeRecvFrq = function() { if ($scope.transv_frq > 200000 && $scope.transv_frq <= 225000) $scope.transv_frq = 200000; if ($scope.transv_frq > 225000 && $scope.transv_frq < 250000) $scope.transv_frq = 250000; } }); 
 <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> <div ng-app="myApp"> <div ng-controller="SomeController"> Частота передачи: {{transv_frq}} Гц <div> <input type="range" style ="width: 300px" id="TransiveFrequency" ng-model="transv_frq" ng-change="ChangeRecvFrq()" value="transv_frq" min="90000" max="400000" step="25"> </div> </div> </div>