Based on jQuery. Hz2Py. js plug in to achieve Chinese characters to pinyin special effects

  • 2020-06-07 03:59:48
  • OfStack

Chinese characters can be converted into pinyin code based on jQuery. This is a special effect based on jQuery. Hz2Py. js. The plugin downloads itself. Use it as follows (note the modification of the jq introduction path).


<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> Based on the jQuery Chinese characters into pinyin code </title>
<style type="text/css">
#content{
border: 1px #dbdbdb solid;
width: 700px;
height: 50px;
padding: 10px;
font-size: 13px;
line-height: 23px;
letter-spacing: 15px;
}
#show{
border: 1px #dbdbdb solid;
width: 700px;
height: 50px;
padding: 10px;
font-size: 12px;
color: #FF0000;
line-height: 23px;
margin-top: 2px;
letter-spacing: 1px;
overflow-x: hide;
overflow-y: auto;
}
#show a {
color: #FF0000;
font-size: 13px;
font-weight: bold;
}
</style>
 
<script src="js/jquery.min.js"></script>
 
<script type="text/javascript" src="js/jQuery.Hz2Py-min.js"></script>
 
<script type="text/javascript">
    $(function () {
      $("#content").live("keyup keydown change blur", function () {
        $("#show").val($(this).toPinyin());
      });
    });
  </script>
 </head><body>
<center>
   Enter Chinese characters here  <textarea id="content"> </textarea> <textarea id="show"></textarea>
</center></body></html>

Demo address: http: / / demo ofstack. com/js / 2015 / jQuery hzzhwpy /

Download address: https: / / www ofstack. com jiaoben / 316390. html

This is the end of this article, I hope you enjoy it.


Related articles: