search
HomeWeb Front-endJS TutorialSwipe the pinyin initials on the mobile phone touch screen to select a city

This time I will bring you the touch screen of mobile phone to select the city by sliding the first letter of Pinyin. What are the precautions? Here are the practical cases. Let’s take a look. .

Today I use city selection, directly use the Pinyin sliding method to select, and introduce jquery when using it (some styles need to be modified by yourself)

<p><img  src="/static/imghwm/default1.png" data-src="images/dizhi.png" class="lazy" alt="Swipe the pinyin initials on the mobile phone touch screen to select a city" ><em>北京</em></p>
<!--省份列表-->
<p>
 <nav>
  <p>
   <a><!--<img src="/static/imghwm/default1.png"  data-src="images/dhjt.png"  class="lazy"   alt="">--></a>
   <span>全部地址</span>
  </p>
 </nav>
 <!--显示点击的是哪一个字母-->
 </p><p><span>当前</span></p>
 <!--城市索引查询-->
 <p>
  </p>
       
  • 当前
  •    
  • 热门
  •    
  • A
  •    
  • B
  •    
  • C
  •    
  • D
  •    
  • E
  •    
  • F
  •    
  • G
  •    
  • H
  •    
  • J
  •    
  • K
  •    
  • L
  •    
  • M
  •    
  • N
  •    
  • P
  •    
  • Q
  •    
  • R
  •    
  • S
  •    
  • T
  •    
  • W
  •    
  • X
  •    
  • Y
  •    
  • Z
  •   
     

  

   

当前城市     

徐州市

       

热门城市     

北京市

    

上海市

    

云南

    

四川

    

济南

    

青岛

       

A     

鞍山市

    

阿拉善盟

    

安庆市

    

安阳市

    

阿里地区

    

安康市

    

安顺市

    

阿坝藏族羌族自治州

    

阿拉尔市

    

阿克苏地区

    

澳门特别行政区

    

阿勒泰地区

       

B     

白城市

    

包头市

    

巴彦淖尔市

    

保定市

    

本溪市

    

白山市

    

亳州市

    

蚌埠市

    

滨州市

    

白银市

    

宝鸡市

    

保山市

    

白沙黎族自治县

    

百色市

    

毕节市

    

北海市

    

巴中市

    

保亭黎族苗族自治县

    

巴音郭楞蒙古自治州

    

博尔塔拉蒙古自治州

    

北京市

       

C     

长治市

    

沧州市

    

常州市

    

慈溪市

    

常熟市

    

承德市

    

赤峰市

    

长春市

    

郴州市

    

长沙市

    

滁州市

    

常德市

    

巢湖市

    

池州市

    

澄迈县

    

崇左市

    

昌江黎族自治县

    

楚雄彝族自治州

    

潮州市

    

重庆市

    

成都市

    

昌都地区

    

昌吉回族自治州

       

D     

大兴安岭地区

    

大同市

    

大庆市

    

丹阳市

    

大连市

    

丹东市

    

东营市

    

德州市

    

达州市

    

大理白族自治州

    

儋州市

    

定安县

    

迪庆藏族自治州

    

德阳市

    

东方市

    

德宏傣族景颇族自治州

    

东莞市

    

定西市

       

E     

鄂尔多斯市

    

鄂州市

    

恩施土家族苗族自治州

       

F     

阜新市

    

抚顺市

    

福清市

    

阜阳市

    

肥城市

    

抚州市

    

福州市

    

佛山市

    

防城港市

       

G     

广州市

    

赣州市

    

广元市

    

广安市

    

桂林市

    

贵港市

    

贵阳市

    

甘孜藏族自治州

    

甘南藏族自治州

    

固原市

    

果洛藏族自治州

       

H     

黑河市

    

葫芦岛市

    

海宁市

    

淮安市

    

衡水市

    

呼和浩特市

    

湖州市

    

鹤岗市

    

呼伦贝尔市

    

哈尔滨市

    

邯郸市

    

杭州市

    

鹤壁市

    

菏泽市

    

黄石市

    

怀化市

    

淮北市

    

黄冈市

    

衡阳市

    

合肥市

    

淮南市

    

黄山市

    

河池市

    

海口市

    

河源市

    

红河哈尼族彝族自治州

    

惠州市

    

汉中市

    

贺州市

    

海西蒙古族藏族自治州

    

海东市

    

黄南藏族自治州

    

哈密地区

    

海北藏族自治州

    

和田地区

    

海南藏族自治州

       

J     

锦州市

    

金华市

    

晋中市

    

江阴市

    

吉林市

    

佳木斯市

    

鸡西市

    

嘉兴市

    

晋城市

    

晋江市

    

即墨市

    

吉安市

    

济南市

    

荆门市

    

焦作市

    

济宁市

    

济源市

    

荆州市

    

九江市

    

景德镇市

    

揭阳市

    

金昌市

    

江门市

    

嘉峪关市

    

酒泉市

       

K     

昆山市

    

开封市

    

昆明市

    

克拉玛依市

    

克孜勒苏柯尔克孜自治州

    

喀什地区

       

L     

临汾市

    

廊坊市

    

辽阳市

    

辽源市

    

吕梁市

    

连云港市

    

莱芜市

    

漯河市

    

丽水市

    

六安市

    

娄底市

    

龙岩市

    

龙口市

    

临沂市

    

洛阳市

    

聊城市

    

丽江市

    

来宾市

    

泸州市

    

临沧市

    

乐东黎族自治县

    

乐山市

    

兰州市

    

柳州市

    

凉山彝族自治州

    

陵水黎族自治县

    

林芝地区

    

临高县

    

拉萨市

    

六盘水市

    

陇南市

    

临夏回族自治州

       

M     

牡丹江市

    

马鞍山市

    

绵阳市

    

眉山市

    

茂名市

    

梅州市

       

N     

南京市

    

宁波市

    

南通市

    

南昌市

    

南阳市

    

南平市

    

宁德市

    

南安市

    

那曲地区

    

南宁市

    

南充市

    

内江市

    

怒江傈僳族自治州

       

P     

盘锦市

    

萍乡市

    

平顶山市

    

濮阳市

    

莆田市

    

攀枝花市

    

普洱市

    

平凉市

       

Q     

秦皇岛市

    

齐齐哈尔市

    

七台河市

    

泉州市

    

潜江市

    

青岛市

    

衢州市

    

清远市

    

黔南布依族苗族自治州

    

钦州市

    

曲靖市

    

黔西南布依族苗族自治州

    

庆阳市

    

黔东南苗族侗族自治州

    

琼海市

    

琼中黎族苗族自治县

       

R     

如皋市

    

荣成市

    

日照市

    

日喀则市

       

S     

四平市

    

绥化市

    

松原市

    

苏州市

    

上海市

    

宿迁市

    

绍兴市

    

朔州市

    

双鸭山市

    

沈阳市

    

上虞市

    

石家庄市

    

汕头市

    

三明市

    

神农架林区

    

上饶市

    

商丘市

    

随州市

    

宿州市

    

三门峡市

    

十堰市

    

深圳市

    

邵阳市

    

韶关市

    

汕尾市

    

遂宁市

    

商洛市

    

山南地区

    

三亚市

    

石嘴山市

    

石河子市

       

T     

太原市

    

铁岭市

    

通化市

    

唐山市

    

太仓市

    

天津市

    

泰州市

    

通辽市

    

台州市

    

泰安市

    

天门市

    

铜陵市

    

铜仁市

    

屯昌县

    

铜川市

    

天水市

    

塔城地区

    

图木舒克市

    

吐鲁番地区

    

台湾

       

W     

温州市

    

无锡市

    

乌兰察布市

    

乌海市

    

芜湖市

    

武汉市

    

潍坊市

    

威海市

    

万宁市

    

渭南市

    

文昌市

    

五指山市

    

武威市

    

梧州市

    

文山壮族苗族自治州

    

五家渠市

    

吴忠市

    

乌鲁木齐市

       

X     

忻州市

    

锡林郭勒盟

    

邢台市

    

兴安盟

    

徐州市

    

新乡市

    

襄阳市

    

新余市

    

信阳市

    

仙桃市

    

许昌市

    

湘潭市

    

厦门市

    

宣城市

    

孝感市

    

咸宁市

    

湘西土家族苗族自治州

    

西安市

    

咸阳市

    

西双版纳傣族自治州

    

西宁市

    

香港特别行政区

       

Y     

宜兴市

    

延边朝鲜族自治州

    

扬州市

    

运城市

    

盐城市

    

阳泉市

    

余姚市

    

伊春市

    

营口市

    

烟台市

    

宜昌市

    

岳阳市

    

宜春市

    

益阳市

    

义乌市

    

鹰潭市

    

永州市

    

玉林市

    

雅安市

    

玉溪市

    

阳江市

    

榆林市

    

宜宾市

    

云浮市

    

延安市

    

伊犁哈萨克自治州

    

银川市

    

玉树藏族自治州

       

Z     

张家口市

    

诸暨市

    

镇江市

    

张家港市

    

朝阳市

    

张家界市

    

郑州市

    

枣庄市

    

舟山市

    

增城市

    

珠海市

    

周口市

    

淄博市

    

株洲市

    

漳州市

    

驻马店市

    

湛江市

    

遵义市

    

自贡市

    

昭通市

    

肇庆市

    

中山市

    

张掖市

    

资阳市

    

中卫市

         <script> $(function(){ $(".yp_indz").click(function(){ $(".dzhc_xs").addClass(&#39;on&#39;); }); $(".yy_gb").click(function(){ $(".dzhc_xs").removeClass(&#39;on&#39;); }) //加载城市事件 $(&#39;.container&#39;).show(); //选择城市 start $("body").on(&#39;click&#39;, &#39;.city-list p&#39;, function () { $(".yp_indz em").text($(this).html()); $(".dzhc_xs").removeClass("on"); }); //点击索引查询城市 $("body").on(&#39;click&#39;, &#39;.letter a&#39;, function () { var s = $(this).data("html"); $(window).scrollTop($(&#39;#&#39; + s + &#39;1&#39;).offset().top); $("#showLetter span").html($(this).html()); $("#showLetter").show().delay(500).hide(0); }); //中间的标记显示 /*$("body").on(&#39;onMouse&#39;, &#39;.showLetter span&#39;, function () { $("#showLetter").show().delay(500).hide(0); });*/ }) </script>rrree

Final renderings

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

How jQuery controls dynamic page elements

How two zTree interact with each other

How to automatically convert uppercase and lowercase letters when jackson parses a json string

What to do if there is no reflection after the ajax request for background data is successful

Usage of jQuery EasyUI folding panel

The above is the detailed content of Swipe the pinyin initials on the mobile phone touch screen to select a city. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Python vs. JavaScript: Community, Libraries, and ResourcesPython vs. JavaScript: Community, Libraries, and ResourcesApr 15, 2025 am 12:16 AM

Python and JavaScript have their own advantages and disadvantages in terms of community, libraries and resources. 1) The Python community is friendly and suitable for beginners, but the front-end development resources are not as rich as JavaScript. 2) Python is powerful in data science and machine learning libraries, while JavaScript is better in front-end development libraries and frameworks. 3) Both have rich learning resources, but Python is suitable for starting with official documents, while JavaScript is better with MDNWebDocs. The choice should be based on project needs and personal interests.

From C/C   to JavaScript: How It All WorksFrom C/C to JavaScript: How It All WorksApr 14, 2025 am 12:05 AM

The shift from C/C to JavaScript requires adapting to dynamic typing, garbage collection and asynchronous programming. 1) C/C is a statically typed language that requires manual memory management, while JavaScript is dynamically typed and garbage collection is automatically processed. 2) C/C needs to be compiled into machine code, while JavaScript is an interpreted language. 3) JavaScript introduces concepts such as closures, prototype chains and Promise, which enhances flexibility and asynchronous programming capabilities.

JavaScript Engines: Comparing ImplementationsJavaScript Engines: Comparing ImplementationsApr 13, 2025 am 12:05 AM

Different JavaScript engines have different effects when parsing and executing JavaScript code, because the implementation principles and optimization strategies of each engine differ. 1. Lexical analysis: convert source code into lexical unit. 2. Grammar analysis: Generate an abstract syntax tree. 3. Optimization and compilation: Generate machine code through the JIT compiler. 4. Execute: Run the machine code. V8 engine optimizes through instant compilation and hidden class, SpiderMonkey uses a type inference system, resulting in different performance performance on the same code.

Beyond the Browser: JavaScript in the Real WorldBeyond the Browser: JavaScript in the Real WorldApr 12, 2025 am 12:06 AM

JavaScript's applications in the real world include server-side programming, mobile application development and Internet of Things control: 1. Server-side programming is realized through Node.js, suitable for high concurrent request processing. 2. Mobile application development is carried out through ReactNative and supports cross-platform deployment. 3. Used for IoT device control through Johnny-Five library, suitable for hardware interaction.

Building a Multi-Tenant SaaS Application with Next.js (Backend Integration)Building a Multi-Tenant SaaS Application with Next.js (Backend Integration)Apr 11, 2025 am 08:23 AM

I built a functional multi-tenant SaaS application (an EdTech app) with your everyday tech tool and you can do the same. First, what’s a multi-tenant SaaS application? Multi-tenant SaaS applications let you serve multiple customers from a sing

How to Build a Multi-Tenant SaaS Application with Next.js (Frontend Integration)How to Build a Multi-Tenant SaaS Application with Next.js (Frontend Integration)Apr 11, 2025 am 08:22 AM

This article demonstrates frontend integration with a backend secured by Permit, building a functional EdTech SaaS application using Next.js. The frontend fetches user permissions to control UI visibility and ensures API requests adhere to role-base

JavaScript: Exploring the Versatility of a Web LanguageJavaScript: Exploring the Versatility of a Web LanguageApr 11, 2025 am 12:01 AM

JavaScript is the core language of modern web development and is widely used for its diversity and flexibility. 1) Front-end development: build dynamic web pages and single-page applications through DOM operations and modern frameworks (such as React, Vue.js, Angular). 2) Server-side development: Node.js uses a non-blocking I/O model to handle high concurrency and real-time applications. 3) Mobile and desktop application development: cross-platform development is realized through ReactNative and Electron to improve development efficiency.

The Evolution of JavaScript: Current Trends and Future ProspectsThe Evolution of JavaScript: Current Trends and Future ProspectsApr 10, 2025 am 09:33 AM

The latest trends in JavaScript include the rise of TypeScript, the popularity of modern frameworks and libraries, and the application of WebAssembly. Future prospects cover more powerful type systems, the development of server-side JavaScript, the expansion of artificial intelligence and machine learning, and the potential of IoT and edge computing.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor