跟随文本框的DIV
来源:互联网 发布:seo专员是做什么的 编辑:程序博客网 时间:2024/05/17 04:32
<input type=text name=t1 onfocus="popShow(this);"><br>
<input type=text name=t2 onfocus="popShow(this);"><br>
<input type=text name=t3 onfocus="popShow(this);">
<input type=text name=t4 onfocus="popShow(this);">
<div id="pop" style="position: absolute; width: 250; display: none; z-index: 99;
font-size: 13px; background: #ffff00">
</div>
<script language=javascript>
document.onclick= popHidden;
var t1Option = "<table border=0 width=100%>";
t1Option += "<tr style='cursor:hand;' onclick='usingObject.value=(this.innerText);popHidden();' onmouseover='this.style.backgroundColor=/"#99ff33/";' onmouseout='this.style.backgroundColor=/"#ffff00/";'><td>123</td></tr>";
t1Option += "<tr style='cursor:hand;' onclick='usingObject.value=(this.innerText);popHidden();' onmouseover='this.style.backgroundColor=/"#99ff33/";' onmouseout='this.style.backgroundColor=/"#ffff00/";'><td>456</td></tr>";
t1Option += "</table>";
function popShow(e)
{//显示信息
e.select();
var moneyMsg = document.all.pop;
//moneyMsg.style.background = "#FFFF00";
var opn = t1Option;
while(opn.indexOf("usingObject") >= 0)
opn = opn.replace("usingObject",e.name);
moneyMsg.innerHTML = opn;
//下面计算位置进行显示
moneyMsg.style.display = ""; //层显示
moneyMsg.style.top = e.getBoundingClientRect().top + 20 + document.body.scrollTop;//ttop + h;
moneyMsg.style.left= e.getBoundingClientRect().left + 0 + document.body.scrollLeft;//tleft + w - moneyMsg.clientWidth;
}
function popHidden()
{//隐藏信息
if(event.srcElement.tagName == "BODY")
document.all.pop.style.display = 'none';
}
</script>
- 跟随文本框的DIV
- 鼠标跟随的div
- 一串跟随鼠标的div
- 键盘的通知 文本框跟随键盘移动
- 一个跟随鼠标移动的DIV
- JS跟随页面移动的div
- 自写的文本框 输入法框跟随光标 实现方法
- DIV跟随鼠标显示
- div跟随javasript
- DIV 跟随屏幕滚动
- div跟随鼠标写法
- 跟随鼠标移动div
- 跟随垂直滚动条滚动的DIV实现
- DIV+js+css跟随鼠标的浮动提示框
- 仿照网易首页1【悬浮跟随页面滚动的div】
- 如何设置跟随滚动条一起滚动的div
- 让div高度跟随窗口高度自适应的方法
- Event—跟随鼠标移动的div实例阻止冒泡
- Size Balanced Tree
- 技术发展的道路究竟应该是怎样的?
- SQL查询(三)技巧
- 今天是妈妈的生日。
- IHTMLDocument3接口类成员
- 跟随文本框的DIV
- Eclipse 中Template 的使用
- 简单的SSH整合登录注册
- mysql数据库的操作总结
- 基础知识打牢固了,就是王道
- 逆势而上,Intel大连工厂高价挖人
- 人的一生
- 如何最大限度提高.NET的性能
- 准备考系统分析师