求指点。。自己写 confirm这样组件 ,代码不知道哪错了求指点!
web吧
全部回复
仅看楼主
level 1
肛忆机1h 楼主
<!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>dialog</title>
<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js">
</script>
<style>
#bb{
width:100%;height:100%;position:absolute;z-index:13;left:0;top:0;background-color:#333333; display:none;
}
</style>
</head>
<body>
<div id="abc"><input type="button" class="sb1" value="real delete?"/></div>
<div id="bb">
<input type="button" class="log_but" value="log_but"/>
<input type="button" class="log_but2" value="log_but2"/>
</div>
<script>
var json={
name:424,
width:500,
whenyou_real:function(){alert(this.name);return true},
whenyou_think:function(){alert(this.width);return false}
}
$(".sb1").click(function(){
//go fb
var bool=conf(json);
//go other
alert('even go');
});
function conf(obj)
{
//return (obj.whenyou_real());
//alert(23);
$("#bb").css("display","block");
$(".log_but").click(function(){ obj.whenyou_real();});
$(".log_but2").click(function(){ obj.whenyou_think();});
}
/***
function fa(f1,f2)
{
f1();
alert('this is me');
f2();
}
var f1=function(){alert('this is 1');return false;};
var f2=function(){alert('this is 2')};
//alert(23);
***/
</script>
</body>
</html>
2016年08月14日 03点08分 1
1