$(function () { $("body").scroll(function () { $("#nav thead>tr>th").each(function () { $(this).width($(this).width()); }); $("#nav tbody > tr:nth(0)>td").each(function () { $(this).width($(this).width()); }); var bodyTop = $("body").scrollTop(); var navTop = $("#nav")[0].offsetTop; //console.log(bodyTop); //console.log(navTop); if ( (35 +bodyTop) >= navTop) { $("#nav > thead").addClass("fixed"); } else { $("#nav > thead").removeClass("fixed"); } }) })
1.
2.获取前一周的周五方法
var date = new Date(); var day = date.getDay(); var newDate = new Date(); if (date.getDate() <= 7) { newDate = new Date(date.getFullYear(), date.getMonth(), 1); newDate.setDate(newDate.getDate() - 1); } else { day = day || 7; newDate = new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1 - day); newDate.setDate(newDate.getDate() - 3); } $('#mydatepicker').val(newDate.Format('yyyy-MM-dd')); getOperaSavePipelineData();