一、css
1、css样式子元素设置:display: inline-block; 父元素(没有设置宽高和绝对定位的情况下)设置: white-space:nowrap;可以让子元素排一列;
2、contain 就是 100% auto ;cover 就是auto 100%
3、bootstrap 按钮点击边框
<buttom style="color: #fff;display: block; 380px;height: 86px;text-align: center;line-height: 86px;font-size: 36px;background: linear-gradient(135deg, transparent 5% , #ff003c 5%);">ONCEWEB</buttom>
5、实现背景方格 :background-images、background-size:50px 50px;
linear-gradient(0deg,transparent 24%,rgba(201,195,195,.329) 25%,hsla(0,8%,80.4%,.05) 26%,transparent 27%,transparent 74%,hsla(0,5.2%,81%,.185) 75%,rgba(180,176,176,.05) 76%,transparent 77%,transparent),linear-gradient(90deg,transparent 24%,rgba(204,196,196,.226) 25%,hsla(0,4%,66.1%,.05) 26%,transparent 27%,transparent 74%,hsla(0,5.2%,81%,.185) 75%,rgba(180,176,176,.05) 76%,transparent 77%,transparent)
二、javascript
1、实现数组分隔插入html标签中
splitMessage: function () {
var valHtml = this.detail.expression.split('+')
var str = ""
for (var valHtmlMsg of valHtml) {
str+="<span>"+valHtmlMsg+"</span>+";
}
str+="";
return str.substring(0, str.lastIndexOf('+'));
}
2、返回时间截
var nn = new Date().getTime()
var fn = Date.parse(new Date())
console.log(nn+'
'+fn)
3、在bat文件中设置打开node再在浏览器中打开指定地址,以此类推call start ****
call start node server.js
call start chrome.exe 127.0.0.1:8132/index.html
4、跟随的广告(position:absolute)
$(window).scroll(function() {
var val=$(document).scrollTop();
$("#id").stop().animate({"top":val+100}, 1000)
});
5、设置过滤显示数据
var key = obj.part.__gohashid;
window.nodeCurrentData = window.nodeCurrentData || {};
var datas = window.nodeCurrentData[key] = window.nodeCurrentData[key] || [{"objId":obj.part.__gohashid,"explain":"","trigger":"","import":""}];
hm_app.jbsx_input_list = datas