如何在angularjs选择框中使用ng-scrollbar?

时间:2016-06-12 09:43:03

标签: php css angularjs

在我的项目中,我使用的是angularjs选择框。我需要为selctbox滚动条提供一个自定义样式。使用ng-scrollbar我试过但它不起作用

这是ng-scrollbar click here的参考 我用过的

我刚刚添加了一个选择框并试过但它不能正常工作

请帮帮我

这是我的代码

<div ng-app="myapp">
  <div class="container" ng-controller="myctrl">

    <div class="page-header">
      <h1>ngScrollBar <small>example</small></h1>
    </div>
    Bar is shown: {{barShown}}
    <div class="well" >
      <div class="scrollme" ng-scrollbar is-bar-shown="barShown">
        <h1>Scroll me down!</h1>
        <p>...</p>
        <p>...</p>
        <p><a class="btn btn-primary btn-lg" role="button" href="https://github.com/asafdav/ng-scrollbar">Learn more</a></p>
      </div>
    </div>


    <select class="scrollme" ng-options="lt.id as lt.value for lt in Value" ng-model="selectedValue" ng-change="onChange(selectedValue)">
        <option value="" >Select</option>
        </select>
  </div>
</div>

脚本

<script>
  var myapp = angular.module('myapp', ['ngSanitize', 'ngScrollbar']);

  myapp.controller('myctrl', function ($scope)
 {

    $scope.Value = [{ id: 1, value: '1'},{ id: 2, value: '2 - 0.76'},{ id: 3, value: '3 - 1.14'},{ id: 4, value: '4 - 1.52'},{ id: 5, value: '5 - 1.9'},
        { id: 6, value: '6 - 2.28'},{ id: 7, value: '7 - 2.66'},{ id: 8, value: '8 - 3.04'},{ id: 9, value: '9 - 3.42'},{ id: 10, value: '10 - 3.8'},
        { id: 11, value: '11 - 4.18'},{ id: 12, value: '12 - 4.56'}];

  });
</script>

0 个答案:

没有答案