//网页可见区域宽:document.body.clientWidth
// 网页可见区域高:document.body.clientHeight
// 网页可见区域宽:document.body.offsetWidth (包括边线的宽)
// 网页可见区域高:document.body.offsetHeight (包括边线的宽)// var see_width = document.body.clientWidth
// var see_height = document.body.clientHeight// 网页正文全文宽:document.body.scrollWidth
// 网页正文全文高:document.body.scrollHeight// var content_width = document.body.scrollWidth
// var content_height = document.body.scrollHeight// 对有doctype申明的页面 可以使用:document.documentElement.scrollTop
// 没有doctype申明的页面使用:document.body.scrollTop
// safari:特例独行:使用 window.pageYOffset// dangqian滚动条最终位置 // 元素相对于页面中的位置 offset().top; offset().left;
// var ele_position = $(".div2").offset().top;
// console.log('ele_position = ' + ele_position);//网页当前可视区域高度
var page_view_height = $(window).height()
console.log('page_view_height = ' + page_view_height);// 进入判断 自身顶端位置 减去 屏幕可视高度
area3_goin = $('.div3').offset().top - page_view_height;
console.log('goinaere3 = ' + area3_goin);//离开判断 进入位置 加上 自身高度
area3_goout = area3_goin + $(".div3").height();
console.log('goinaere3 = ' + area3_goout);
file上传图片中获得图片宽高的方式
// 得到文件
var file = $(this)[0].files[0];//本地读取文件
var reader = new FileReader();
reader.readAsDataURL(file);reader.onload = function () {// 读取的URL结果:this.result$("#clipimg1").attr("src", this.result);$("#clipimg2").attr("src", this.result);let img = new Image();img.src = this.result;img.onload = function(){console.log(this.height);console.log(this.width);}$("#clip_show").show();
}