How to realize the function of 12306 City selection Box by jQuery
This article mainly introduces jQuery how to achieve 12306 city selection box function related knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that everyone after reading this jQuery how to achieve 12306 city selection box function article will have a harvest, let's take a look at it.
The specific code is as follows:
Www.jb51.net jQuery City selection Box # parent {width:500px; position:relative;} # text {height:25px;} # select {width:420px; height:185px; position:absolute; top:31px; left:0; background:#eeeeee;} .cities {width:60px Height:25px; line-height:25px; margin:5px 5px 0 5px; float:left; text-align:center; font-family:'Times New Roman'; font-size:15px; cursor:pointer;} $(document) .ready (function () {$("# select"). Hide () $("# text") .focus (function () {$("# select"). Show ();}); $(".attention") .click (function () {$("# text"). Val ($(this). Text ()); $("# select"). Hide ();}) $("# text") .blur (function () {setTimeout (function () {$("# select"). Hide ();}, 300);}) Urumqi Lanzhou Xining Lhasa Hohhot Harbin Changchun Shenyang Sanya Beijing Tianjin Taiyuan Jinan Yinchuan Xi'an Zhengzhou Nanjing Hangzhou Fuzhou Guangzhou Taipei Nanning Kunming Chengdu Chongqing Guiyang Changsha Nanchang Hefei Wuhan Shanghai Haikou Hong Kong Macao
The running effect is as follows:
This is the end of the article on "how to achieve the function of 12306 city selection box in jQuery". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to achieve 12306 city selection box function in jQuery". If you want to learn more knowledge, you are welcome to follow the industry information channel.