jquery点击其它地方,关闭层的问题 一个ID为take_shop_id的input当点击input 框时会弹出一个层这个层ID为my_shop怎样可以实现点击除了take_shop_id和my_shop外的任何地方,隐藏掉 my_shop这个层呢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!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><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script></head><body><input id="take_shop_id" type="button" value="22222222222222" /><div id="my_shop" style="display:none; background:#CCCCCC; height:200px"><p>无标题文档无标题文档</p></div><div style="background-color:#EEE">无标题文档</div><div style="background-color:#999">无标题文档</div><div style="background-color:#EEE">无标题文档</div><div style="background-color:#999">无标题文档</div><div style="background-color:#EEE">无标题文档</div><div style="background-color:#999">无标题文档</div><div style="background-color:#EEE">无标题文档</div><div style="background-color:#999">无标题文档</div><div style="background-color:#EEE">无标题文档</div><div style="background-color:#999">无标题文档</div><script type="text/javascript">//<![CDATA[$(function(){ $('#take_shop_id').click(function(){ $('#my_shop').show(); $('body').one('click',function(){ $('#my_shop').hide(); }); return false; }); $('#my_shop').click(function(){ return false; });})//]]></script></body></html> $("#take_shop_id").click(function(){ $("#id").show();//层的id暂时设置为id});$("body").click(function(){ $("#id").hide();}) $('#my_shop').click(function(){ return false; }); 关于addEvent()的一个问题 如何动态识别字符串中的url document.write的一点困惑 能否给我推荐一个 js 写的 DataGrid 能否在表格的单击事件中确定哪行哪列发出了单击事件? JavaScript验证文本框输入问题 这个下拉式菜单的问题出在哪呀? 关于父窗口控制子窗口元素属性问题,在线等!!! 急!怎么用jascript的方法知道某一个字母的ascII码 请问怎么定制自己的文件上传框的按钮风格 一个关于TABLE的问题 请教一个JS里引用input的name值的
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
</head><body>
<input id="take_shop_id" type="button" value="22222222222222" />
<div id="my_shop" style="display:none; background:#CCCCCC; height:200px"><p>无标题文档无标题文档</p></div>
<div style="background-color:#EEE">无标题文档</div>
<div style="background-color:#999">无标题文档</div>
<div style="background-color:#EEE">无标题文档</div>
<div style="background-color:#999">无标题文档</div>
<div style="background-color:#EEE">无标题文档</div>
<div style="background-color:#999">无标题文档</div>
<div style="background-color:#EEE">无标题文档</div>
<div style="background-color:#999">无标题文档</div>
<div style="background-color:#EEE">无标题文档</div>
<div style="background-color:#999">无标题文档</div>
<script type="text/javascript">
//<![CDATA[
$(function(){
$('#take_shop_id').click(function(){
$('#my_shop').show();
$('body').one('click',function(){
$('#my_shop').hide();
});
return false;
});
$('#my_shop').click(function(){
return false;
});
})
//]]>
</script>
</body>
</html>
$("#take_shop_id").click(function(){
$("#id").show();//层的id暂时设置为id
});
$("body").click(function(){
$("#id").hide();
})
$('#my_shop').click(function(){
return false;
});