----------------------------1,div自动宽度----------------------------------
<div id="container"> <div id="left">左边</div> <div id="mid"><input type="text" style="100%" value="我是变化的,是扣掉左右之后剩下的,但不会破坏父容器的宽度。" /></div> <div id="right">右边</div> </div>
#container {
400px;
height: 200px;
display: table
}
#left, #mid, #right {
display: table-cell;
background: #ccc;
outline: 2px dashed blue
}
#mid {
100%;
background: #f0f;
}
#left,#right {
padding-left:15px;
padding-right:15px;
white-space:nowrap;
}
http://jsfiddle.net/xhCXq/350/
-------------------------------2,ul居中------------------------------------
取消li下的float;即不让li浮动,
li{display:inline-block; zoom:1; *display:inline;}
然给外面的容器元素 text-align:center
var formatDateTime = function () {
date = new Date();
var y = date.getFullYear();
var m = date.getMonth() + 1;
m = m < 10 ? ('0' + m) : m;
var d = date.getDate();
d = d < 10 ? ('0' + d) : d;
var h = date.getHours();
var minute = date.getMinutes();
minute = minute < 10 ? ('0' + minute) : minute;
var seconds = date.getSeconds();
seconds = seconds < 10 ? ('0' + seconds) : seconds;
return y + '-' + m + '-' + d+' '+h+':'+minute+':'+seconds;
};
修改history地址
var stateObject = {};
var title = "修改地址";
var newUrl = '/Event/WxContest?matchid=2000978';
//修改地址栏中的地址
history.pushState(stateObject, title, newUrl);
ios竟然不行??
http://www.cnblogs.com/rainman/archive/2011/02/20/1959054.html
以后不要在代码里用die或exit 会导致后面log写不了
header跳转都用tp的$this->redirect() 函数替代就可以又跳转又可以继续执行后面代码
http://www.cnblogs.com/2050/p/3392803.html