62,046
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<script language="javascript" type="text/javascript">
var _txt;
//设置tipbar的位置
function setTipLocation(e)
{
var intX=0,intY=0;
//判断有没有收到firefox的监听的event
if(e == null)
{
//当没收到时用window.event IE与Opera支持的
e = window.event;
}
if(e.pageX || e.pageY)
{
intX=e.pageX; intY=e.pageY;
}
else if(e.clientX || e.clientY)
{
if(document.documentElement.scrollTop)
{
intX=e.clientX+document.documentElement.scrollLeft;
intY=e.clientY+document.documentElement.scrollTop;
}
else
{
intX=e.clientX+document.body.scrollLeft;
intY=e.clientY+document.body.scrollTop;
// alert(intX);
// alert(intY);
}
}
//取得tooltip对象
var tipbar = $("divCho");
tipbar.style.top = (intY+7)+"px";
tipbar.style.left = (intX)+"px";
}
function $(re)
{
return document.getElementById(re);
}
//显示tooltip
function showTipbar(tag)
{
setTipLocation();
_txt=tag;
//取得tooltip对象
var tipbar = $("divCho");
tipbar.style.display = "";
tipbar.style.visibility='visible'
//tag.value="aa";
//alert( tipbar.innerHTML);
}
function show(aa)
{
showTipbar(aa);
}
function inhtml(aa)
{
_txt.value=aa.innerHTML;
var tipbar = $("divCho");
tipbar.style.display = "none";
}
</script>
</head>
<body>
<div id="divCho" title="弹出层" style="position: absolute; top: 0; left: 0; visibility: hidden;">
<a onclick="inhtml(this)" href="#">自提 </a>
<br />
<a onclick="inhtml(this)" href="#">送货 </a>
<br />
</div>
<input type="text" name="sendtype" onclick="show(this)" />
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题页</title>
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#res").css("left",$("#zzz").css("left"));
$("#res").css("top",parseInt($("#zzz").css("top"))+22+"px");
$("#zzz").mouseover(function(){
$("#res").fadeIn();
})
$("#Button1").click(function(){
$("#zzz").empty();
$("#zzz").append("<option>"+$(result).html()+"</option>")
$("#res").fadeOut();
})
$("input[type=checkbox]").click(function(){
if($(this).attr("checked")==true)
$("#result").append($(this).val()+",");
else
$("#result").html($("#result").html().replace($(this).val()+",",""));
})
})
</script>
</head>
<body style="margin:0; padding:0; ">
<select id="zzz" style="left:300px;position:absolute;top:10px;height:22px;">
<option>请选择</option>
</select>
<div id="res" style="width:300px;height:300px;border:1px solid #ccc;z-index:10; background:yellow; FILTER:alpha(opacity=30);opacity=0.3;position:absolute; display:none;">
<input id="Button1" type="button" value="确定" /><span id="result"></span><br />
<input id="Checkbox1" type="checkbox" value="youku"/>youku
<input id="Checkbox2" type="checkbox" value="tudou" />tudou
<input id="Checkbox3" type="checkbox" value="baidu" />baidu
<input id="Checkbox4" type="checkbox" value="google" />google
</div>
</body>
</html>