JS 基础操作
<script type="text/javascript">
function getNowFormatDate() {
var date = new Date();
var seperator1 = "-";//设置成自己想要的日期格式 年-月-日
var seperator2 = ":";//设置成自己想要的时间格式 时:分:秒
var month = date.getMonth() + 1;//月
var strDate = date.getDate();//日
if (month >= 1 && month <= 9)
{
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9)
{
strDate = "0" + strDate;
}
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
+ " " + date.getHours() + seperator2 + date.getMinutes()
+ seperator2 + date.getSeconds();
return currentdate;
}
console.log(getNowFormatDate());
</script>
if (typeof(变量)=="undefound"){}
mouseout 里的子元素离开事件会一同出发父元素的mouseout
mouseleave 只有当鼠标离开该元素才会触发mouseleave
JQ
width() - 返回元素的宽度。 height() - 返回元素的高度。 innerWidth() 方法返回元素的宽度(包括内边距)。 innerHeight() 方法返回元素的高度(包括内边距)。 outerWidth() 方法返回元素的宽度(包括内边距和边框)。 outerHeight() 方法返回元素的高度(包括内边距和边框)。 outerWidth(true) 方法返回元素的宽度(包括内边距、边框和外边距)。 outerHeight(true) 方法返回元素的高度(包括内边距、边框和外边距)。 返回文档(HTML 文档)$(document).height()的高度 返回窗口(浏览器视口)$(window).height()的高度
siblings() 方法返回被选元素的所有同胞元素。 下面的例子返回 <h2> 的所有同胞元素: $(document).ready(function(){ $("h2").siblings(); }); 您也可以使用可选参数来过滤对同胞元素的搜索。 下面的例子返回属于 <h2> 的同胞元素的所有 <p> 元素: $(document).ready(function(){ $("h2").siblings("p"); });

浙公网安备 33010602011771号