项目遇到一个要求,用系统时间减去数据库表内存的一个初始时间:获取当前时间减去系统定义的一个默认初始时间的天数,例如默认日期为1998-08-13
select trunc(sysdate -to_date('1998-08-13','yyyy-mm-dd')) as days from dual
select to_char(sysdate,'yyyy-MM-dd HH24:mm:ss') from dual;
输出 2012-03-02 11:03:32
posted @
2012-03-02 11:14 杨文胜 阅读(8368) |
评论 (1) |
编辑 收藏
最近一个需求,需要div的拖动,经过高手提示,用jquery的$("#DivId").drageable();可以实现。自己按照网上写了一个。代码如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<style type="text/css">
.winFrame{
position:absolute;
border: outset gray 1px;
height:400;
width:500;
}
.winTitle{
position:absolute;
border-bottom:1px solid black;
background-color: background;
width:100%;
height:20px;
cursor:move;
}
.winContent{
position:absolute;
top:30px;
width:100%
padding: 10px;
overflow: auto;
}
</style>
<SCRIPT LANGUAGE="JavaScript">
var a=true;
function beginDrag(elem,event){
var deltaX = event.clientX - parseInt(elem.style.left);
var deltaY = event.clientY - parseInt(elem.style.top);
document.onmousemove=moveHandler;
document.onmouseup=upHandler;
a=true;
function moveHandler(e){
if(a){
if(!e)
e = window.event;
elem.style.left = (e.clientX - deltaX) + "px";
elem.style.top = (e.clientY - deltaY) + "px";
e.cancelBubble = true;
}
}
function upHandler(e){
if(!e)
e = window.event;
a=false;
}
}
</SCRIPT>
</HEAD>
<div class=winFrame style="left:50px;top:50px;">
<div class=winTitle onmousedown="beginDrag(this.parentNode,event);"> 标题 </div>
<div class=winContent>
内容
</div>
</div>
<BODY>
</BODY>
</HTML>
posted @
2011-07-15 17:03 杨文胜 阅读(389) |
评论 (0) |
编辑 收藏