Jquery自动完成iScroll [英] Jquery autocomplete with iScroll

查看:197
本文介绍了Jquery自动完成iScroll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的jQUeryMobile应用程序中使用jQuery自动完成。它工作完美。现在我试图使用iScroll.js滚动查找项目的列表。 这里是我在做什么,

I am using jQuery Autocomplete on my jQUeryMobile application. It works perfectly. Now I'm trying to use iScroll.js to scroll through the list of looked up items. Here is what I am doing,

问题是iscroll只适用于建议框的第一项,在那里我不能滚动整个列表。请帮助我,如果我错过了我的代码中的任何东西。请帮助我使用iScoll实现这一目标。

The problem is that iscroll is applying only for the first item of the suggestion box, where as I'm not able to scroll through entire list .Please help me if I'm missing anything in my code. Please help me to acheive this using iScoll.

找到,我们可以使用自定义触摸基于滚动条的自动完成框,但有一个问题,自定义滚动条仅出现首次搜索,它会从列表中刷新的suggastion框中消失,我如何解决这个问题,因为这两个选项都适用于我在ipad和android中使用我的自动完成。

I found one more way that we can use custom touch based scrollbar for autocomplete box but there is a issue that the custom scrollbar appears only for first search and it disappears from the suggastion box when list get refreshed, How can I fix this, because both options are fine for me for using my autocomplete in ipad and android.

如果任何人认为有一个更好的方法来做这个比iScroll和jScrollPane我开放

If anyone thinks there's a better way to do this than with iScroll and jScrollPane I'm open to suggestions.

推荐答案

我建议中止iScroll方法,并为此使用纯CSS:

i'd suggest to abort the iScroll approach and use plain CSS for this:

.ui-autocomplete {
    max-height: 100px;
    overflow-y: auto;
    /* prevent horizontal scrollbar */
    overflow-x: hidden;
    /* add padding to account for vertical scrollbar */
    padding-right: 20px;
}
/* IE 6 doesn't support max-height
 * we use height instead, but this forces the menu to always be this tall
 */
* html .ui-autocomplete {
    height: 100px;
}

如果你坚持,你可以给自定义滚动条一点帮助从很多 图书馆 there

later on, if you insist, you can assign custom scrollbars with a little help from the many libraries out there created for that purpose.

注意:CSS片段是从官方的 jQuery UI自动完成参考

Note: the CSS snippet is ported from the official jQuery UI AutoComplete reference.

这篇关于Jquery自动完成iScroll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆