Home Web Front-end JS Tutorial Implementation code based on jquery to make ListNav compatible with Chinese pinyin sorting_jquery

Implementation code based on jquery to make ListNav compatible with Chinese pinyin sorting_jquery

May 15, 2018 pm 04:44 PM
Pinyin sorting

The rendering is as follows:
Implementation code based on jquery to make ListNav compatible with Chinese pinyin sorting_jquery
Implementation code based on jquery to make ListNav compatible with Chinese pinyin sorting_jquery

Copy the code The code is as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<title>中文首字母排序</title> 
<link rel="stylesheet" href="css/listnav.css?7.1.34" type="text/css" media="screen" charset="utf-8" /> 
<script src="js/jquery-1.4.4.min.js?7.1.34" type="text/javascript"></script> 
<!--获取中文首字母的函数,需要jQuery支持--> 
<script src="js/jquery.charfirst.pinyin.js?7.1.34" type="text/javascript"></script> 
<!--ListNav是一个用于创建按字母顺序分类导航的jQuery插件。--> 
<script src="js/jquery.listnav.min-2.1.js?7.1.34" type="text/javascript"></script> 
<script type="text/javascript"> 
$(function() { 
$('#myList').listnav({ 
includeOther: true, 
noMatchText: '没有内容', 
prefixes: ['the', 'a'] 
}); 
}) 
</script> 
</head> 
<body> 
<p id="noticeMSG"> 
<label>中文字母序:</label> 
</p> 
<br /> 
<!--显示字母序的层。注:此层id必需是ul的id+"-nav"--> 
<p id="myList-nav"> 
</p> 
<!-- 兼容IE6 加clear:both;--> 
<ul id="myList" style="clear:both;"> 
<li><a href="https://www.jb51.net" target="_blank">123</a></li> 
<li><a href="https://www.jb51.net" target="_blank">aaaaaa</a></li> 
<li><a href="https://www.jb51.net" target="_blank">四川大学</a> </li> 
<li><a href="https://www.jb51.net" target="_blank">四川师范大学</a></li> 
<li><a href="https://www.jb51.net" target="_blank">成都大学</a> </li> 
<li><a href="https://www.jb51.net" target="_blank">成都理工</a> </li> 
<li><a href="https://www.jb51.net" target="_blank">电子科大</a> </li> 
<li><a href="https://www.jb51.net" target="_blank">西南科大</a> </li> 
<li><a href="https://www.jb51.net" target="_blank">西南财大</a> </li> 
<li><a href="https://www.jb51.net" target="_blank">四川音乐学院</a></li> 
<li><a href="https://www.jb51.net" target="_blank">中国</a> </li> 
<li><a href="https://www.jb51.net" target="_blank">你可以动态加载这些内容</a></li> 
<li><a href="https://www.jb51.net" target="_blank">Renner整理</a></li> 
<li><a href="https://www.jb51.net" target="_blank">jb51.net</a></li> 
</ul> 
</body> 
</html>
Copy after login

P.S:
jQuery ListNav Plugin
ListNav is a jQuery plug-in for creating alphabetical navigation.

Statement of this Website
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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Replace String Characters in JavaScript Replace String Characters in JavaScript Mar 11, 2025 am 12:07 AM

Replace String Characters in JavaScript

Custom Google Search API Setup Tutorial Custom Google Search API Setup Tutorial Mar 04, 2025 am 01:06 AM

Custom Google Search API Setup Tutorial

Example Colors JSON File Example Colors JSON File Mar 03, 2025 am 12:35 AM

Example Colors JSON File

8 Stunning jQuery Page Layout Plugins 8 Stunning jQuery Page Layout Plugins Mar 06, 2025 am 12:48 AM

8 Stunning jQuery Page Layout Plugins

Build Your Own AJAX Web Applications Build Your Own AJAX Web Applications Mar 09, 2025 am 12:11 AM

Build Your Own AJAX Web Applications

What is 'this' in JavaScript? What is 'this' in JavaScript? Mar 04, 2025 am 01:15 AM

What is 'this' in JavaScript?

Improve Your jQuery Knowledge with the Source Viewer Improve Your jQuery Knowledge with the Source Viewer Mar 05, 2025 am 12:54 AM

Improve Your jQuery Knowledge with the Source Viewer

10 Mobile Cheat Sheets for Mobile Development 10 Mobile Cheat Sheets for Mobile Development Mar 05, 2025 am 12:43 AM

10 Mobile Cheat Sheets for Mobile Development

See all articles