jquery 中如何实现点击文本框弹出列表信息选择 上图中,怎么样用jquery实现点击文本框后弹出下面的港口选择的列表,供用户选择,将用户选择的结果填入文本框后自动关闭。 在网上找了很多代码,都不好用 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title> <script src="jQuery-ui-1.8.18.custom/js/jquery-1.7.1.min.js" type="text/javascript"></script> <script> window.onload = function () { $("#i").click(function () { var div = $("#ii"); var divoffset = $(this).offset(); div.attr("style", "position:absolute;display:block;"); div.css({ left: divoffset.left,top: divoffset.top+$(this).height()+5}) }) } function closediv() { var div = $("#ii"); div.hide() } </script></head><body> <form id="form1" runat="server"> xxxxxxxx <input id="i" /> <div id="ii" style="display: none" > asdfasas <span onclick="closediv()">关闭</span> </div> </form></body></html>给楼主写了个例子 怎么取消ie的错误提示对话框 求一算法~~~~~` cookie丢失的问题,急..急. 30分请高手帮我检测下网站的安全性,谢谢! 如何用forms验证 请教,ASP2.0中从iFrame里更新上级页面中TreeView的方法 请教一个关于WEB.CONFIG的问题,急~~ 大家来谈谈ASP.NET的页面风格 Json传送数据失败、有点诡异 在线等待:一些比较基础的问题(如数据库的事务,web form控件大小,位置的自动调整) SQL动态赋值 Repeater的循环输出数据 并且相对应的出图片 求教
<head runat="server">
<title></title>
<script src="jQuery-ui-1.8.18.custom/js/jquery-1.7.1.min.js" type="text/javascript"></script>
<script>
window.onload = function () {
$("#i").click(function () {
var div = $("#ii");
var divoffset = $(this).offset();
div.attr("style", "position:absolute;display:block;");
div.css({ left: divoffset.left,top: divoffset.top+$(this).height()+5})
})
}
function closediv() { var div = $("#ii"); div.hide() }
</script>
</head>
<body>
<form id="form1" runat="server">
xxxxxxxx
<input id="i" />
<div id="ii" style="display: none" >
asdfasas
<span onclick="closediv()">关闭</span>
</div>
</form>
</body>
</html>给楼主写了个例子