


jQuery implements input box drop-down list tree plug-in special effects code sharing_jquery
The example in this article describes the jQuery implementation of the input box drop-down list tree plug-in. Share it with everyone for your reference. The details are as follows:
This is a drop-down list tree plug-in source code based on jquery. It is a practical jquery tree drop-down box drop-down tree code. Click on the text box to pop up a tree-shaped drop-down list, and click on the list item to select the text corresponding to the list. It is a very practical special effects source code.
运行效果图: -------------------查看效果 下载源码----------- --------
Tips: If the browser does not work properly, you can try switching the browsing mode.
The jQuery implementation of the input box drop-down list tree plug-in code shared with you is as follows
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>jQuery实现输入框下拉列表树插件代码</title> <link href="css/dtreeck.css" type="text/css" rel="stylesheet" /> </head> <body> <!--代码部分begin--> <table width="100%" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="1" valign="top" width="35%" style="padding-left: 30px;"> </td> <td valign="top" height="65%" align="left"> <form method="post" id="regform"> <table width="70%" cellpadding="1" cellspacing="0" border="0" style="margin-top: 10px;"> <tr> <td width="20%" align="right"> 父 菜 单: </td> <td width="30%" align="left"> <input type="text" id="menu_parent_name" style="width: 150px;"> <input type="hidden" id="menu_parent" name="menu_parent"> <input type="hidden" id="oprate" name="oprate"> <input type="hidden" id="menu_id" name="menu_id"> </td> <td width="20%" align="right"> </td> <td width="30%" align="left"> </td> </tr> </table> </form> </td> </tr> </table> <script src="http://www.lanrenzhijia.com/ajaxjs/jquery.min.js"></script> <script src="js/dtreeck.js"></script> <div id="treediv"> <div align="right"> <a href="javascript:viod(0);" id="closed"><font color="#000">关闭</font></a> </div> <script src="js/lanren.js"></script> </div> <script> //生成弹出层的代码 <!-- 弹出层--> xOffset = 0;//向右偏移量 yOffset = 25;//向下偏移量 var toshow = "treediv";//要显示的层的id var target = "menu_parent_name";//目标控件----也就是想要点击后弹出树形菜单的那个控件id $("#"+target).click(function (){ $("#"+toshow) .css("position", "absolute") .css("left", $("#"+target).position().left+xOffset + "px") .css("top", $("#"+target).position().top+yOffset +"px").show(); }); //关闭层 $("#closed").click(function(){ $("#"+toshow).hide(); }); //判断鼠标在不在弹出层范围内 function checkIn(id){ var yy = 20; //偏移量 var str = ""; var x=window.event.clientX; var y=window.event.clientY; var obj=$("#"+id)[0]; if(x>obj.offsetLeft&&x<(obj.offsetLeft+obj.clientWidth)&&y>(obj.offsetTop-yy)&&y<(obj.offsetTop+obj.clientHeight)){ return true; }else{ return false; } } //点击body关闭弹出层 $(document).click(function(){ var is = checkIn("treediv"); if(!is){ $("#"+toshow).hide(); } }); <!-- 弹出层--> //生成弹出层的代码 //点击菜单树给文本框赋值------------------菜单树里加此方法 function setvalue(id,name){ $("#menu_parent_name").val(name); $("#menu_parent").val(id); $("#treediv").hide(); } </script> <!--代码部分end--> </body> </html>
The above is the jQuery implementation of the input box drop-down list tree plug-in code shared with you. I hope you like it.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Frequently Asked Questions and Solutions for Front-end Thermal Paper Ticket Printing In Front-end Development, Ticket Printing is a common requirement. However, many developers are implementing...

JavaScript is the cornerstone of modern web development, and its main functions include event-driven programming, dynamic content generation and asynchronous programming. 1) Event-driven programming allows web pages to change dynamically according to user operations. 2) Dynamic content generation allows page content to be adjusted according to conditions. 3) Asynchronous programming ensures that the user interface is not blocked. JavaScript is widely used in web interaction, single-page application and server-side development, greatly improving the flexibility of user experience and cross-platform development.

There is no absolute salary for Python and JavaScript developers, depending on skills and industry needs. 1. Python may be paid more in data science and machine learning. 2. JavaScript has great demand in front-end and full-stack development, and its salary is also considerable. 3. Influencing factors include experience, geographical location, company size and specific skills.

How to merge array elements with the same ID into one object in JavaScript? When processing data, we often encounter the need to have the same ID...

Learning JavaScript is not difficult, but it is challenging. 1) Understand basic concepts such as variables, data types, functions, etc. 2) Master asynchronous programming and implement it through event loops. 3) Use DOM operations and Promise to handle asynchronous requests. 4) Avoid common mistakes and use debugging techniques. 5) Optimize performance and follow best practices.

Discussion on the realization of parallax scrolling and element animation effects in this article will explore how to achieve similar to Shiseido official website (https://www.shiseido.co.jp/sb/wonderland/)...

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.

In-depth discussion of the root causes of the difference in console.log output. This article will analyze the differences in the output results of console.log function in a piece of code and explain the reasons behind it. �...
