本文介绍了当我们使用angucomplete在输入框中键入内容时,如何获取滚动条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经完成了一个使用angucomplete语句自动完成的程序.但是当我输入任何键时,我无法获取它,并且在完成匹配次数后,它不会显示在滚动条上.任何人都可以帮助我解决这个问题

I have done a program which does autocomplete using angucomplete statement.but iam unable to get when i enter any key it does not displaying it with scrollbar whne number of matches are done.CAn anyone help me to solve this

//Html file

<!DOCTYPE html>
<html ng-app="myapp">
<head>
<meta charset="UTF-8">
<title>Autocomplete using remote searching</title>

<script src="angularfiles/angular.min.js"></script>
<script src="angularfiles/angular-animate.js"></script>
<script src="angularfiles/ui-bootstrap-tpls-0.13.4.js"></script>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">
<script src="Jsfiles/autourl.js"></script>
<script src="angularfiles/angucomplete-alt.js"></script>
<link rel="stylesheet" href="angularfiles/style.css" />
<link rel="stylesheet" href="angularfiles/angucomplete-alt.css" />
<link rel="stylesheet" href="angularfiles/bariol.css" />
</head>

 <body ng-controller="controller">

    <angucomplete-alt id="members"  pause="400" placeholder="Type to start"
                            selected-object="testObj" maxlength="40" 
                         remote-url="http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address="
                        remote-url-data-field="results"
                        title-field="formatted_address" 
                        minlength="1"
                        discription-field="status"
                         />

</body>
</html>


//JSfile

var app=angular.module("myapp",['ui.bootstrap','angucomplete-alt']);
app.controller("controller",function(){

});

推荐答案

要显示滚动条,您需要将以下CSS样式设置为angucomplete-dropdown类,然后该指令自动将其拾取.

To show scrollbar, you need to set the following css style to angucomplete-dropdown class, and then the directive automatically picks it up.

.angucomplete-dropdown {
    overflow-y: auto;
    max-height: 200px; // your preference
}

请参见示例#1

有关更多信息: https://github.com/ghiden/angucomplete-alt

这篇关于当我们使用angucomplete在输入框中键入内容时,如何获取滚动条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 18:25