您知道电话前缀的任何开源 JQuery 下拉菜单吗? [英] Do you know any opensource JQuery dropdown menu for telephone prefix?
问题描述
我需要做一个下拉菜单来输入电话号码.我想做一些类似于谷歌在他的.我可以修改它来做我想做的事,但这需要时间,我想也许有人已经做了类似的事情.
注意:我分享的链接仅包含国家/地区和国旗.我正在寻找一个完整的下拉菜单,其中包含旗帜、国家/地区名称、原始语言的国家/地区名称、首先添加国家/地区而忽略字母顺序和国际电话前缀的能力.
我也需要这个,所以 我建造了它.
这是现场演示.
目前具有以下特点:
- 在国家/地区下拉列表中,您可以通过键入或使用向上/向下键进行导航
- 选择一个国家会更新输入号码的拨号代码
- 输入不同的拨号代码会自动更新显示的标志
- 指定首选国家/地区"的选项(显示在列表顶部)
我使用以下开源项目构建了它:
- 标记来自 https://github.com/lafeber/world-flags-sprite 的图像和 CSS
- 来自https://github.com/mledoze/countries 的国家/地区数据
- 来自精彩的 libphonenumber 的格式化和验证
I need to do a dropdown menu for entering telephone numbers. I want to do something similar as google does in his registration form. Something like this:
Do you know any opensource dropdown menu for telephone prefix?
I have looking in google and the most similar thing I have found is this menu. I can modify it to do what I want but it will take time and I think maybe someone has already did something similar.
NOTE: The link I am sharing contains only countries and flags. I am looking for a full dropdown containing flags, country names, country names in original language, ability to add a country first ignoring alphabetical order and international phone prefixes.
I also needed this, so I built it.
Here is a live demo.
It currently has the following features:
- In the country dropdown you can navigate by typing, or using the up/down keys
- Selecting a country updates the dial code of the entered number
- Typing a different dial code automatically updates the displayed flag
- Option to specify "preferred countries" (which appear at the top of the list)
I built it out of the following open source projects:
- Flag images and CSS from https://github.com/lafeber/world-flags-sprite
- Country data from https://github.com/mledoze/countries
- Formatting and validation from the wonderful libphonenumber
这篇关于您知道电话前缀的任何开源 JQuery 下拉菜单吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!