1、prop 修改 radio或者checkbox 的选中状态 checked=true/false.
2、input的 input事件,能监听输入状态的改变。
但是 如果是js改变input的值,这样oninput就监听不到,解决方法:
js改变input值的时候,主动触发下 $('#inputID或者Class').trigger('input');
3、防止图片抖动
在外层包裹一个div:
overflow: hidden;
height: 0
padding-bottom:41%
<div class="banner">
<img class="banner-img" src="static/images/swiper1.jpg" alt="">
</div>
.banner
overflow: hidden;
height: 0
padding-bottom:41%
.banner-img
width:100%
4、swiper的 父级和自身元素变化的时候自己刷新
paginationType:'fraction', 使用数字下标
observeParents:true,
observer:true
5、js改变input的值,不会触发监听。
js改变input的值,这时候input的值虽然改变了,但是不会触发input 、change 、blur 之类的事件,需要在改变值之后,执行一个this.trigger('事件类型'),手动触发一下这个事件。
$this.trigger("input");
$this.trigger("blur");
6、。。。宽度不设置,父级加上min-width:0
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
min-width:0
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
.父级{
min-width:0
}
7、2行。。。 ...
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
8、place
.yx_order_cancelle_area textarea::-webkit-input-placeholder{
font-size: 0.1897rem;
color:#999999;
padding: 0.05rem;
}
.yx_order_cancelle_area textarea::-moz-placeholder{ /* Mozilla Firefox 19+ */
font-size: 0.1897rem;
color:#999999;
}
.yx_order_cancelle_area textarea:-moz-placeholder{ /* Mozilla Firefox 4 to 18 */
font-size: 0.1897rem;
color:#999999;
}
.yx_order_cancelle_area textarea:-ms-input-placeholder{ /* Internet Explorer 10-11 */
font-size: 0.1897rem;
color:#999999;
}
9、视频宽高
$('.upload_video_temphd_wrapfn').on('change','.upload_video_temphdfn',function () {
// 获取input的file video
var video = this.files[0];
// 获取url
var url = URL.createObjectURL(video);
// 创建video对象
var video_ele=document.createElement('video');
// 设置video src
video_ele.src = url;
// 展示加载视频蒙版
$.showloading();
video_ele.load()
// 视频数据加载完成后
video_ele.oncanplaythrough=function () {
$.hideloading();
// console.log(video_ele)
// URL.revokeObjectURL(url)
// document.getElementById("getDuration").innerHTML="这段视频的时长为:"+this.duration;
// document.getElementById("getDuration2").innerHTML="这段视频的宽为:"+video_ele.videoWidth;
// document.getElementById("getDuration3").innerHTML="这段视频的高为:"+video_ele.videoHeight;
}
})
10、下载文件 如果content-type 是
application/octet-stream
这是 rar的响应头,如果是这个就会是下载,而不是打开