Javascript滚动到指定位置触发操作

Javascript滚动到指定位置触发操作

$(function() {
	var getDiv_md = $("#vvdeio");
	var offSet = getDiv_md.offset().top;
	$(window).scroll(function(){
		if ($(window).scrollTop() > offSet){
			console.log(1111);
		}else{
			console.log(2222);
		}
	})
})