scrolltop

各大招聘网站信息实时查询浏览【二】

穿精又带淫゛_ 提交于 2019-11-27 11:47:47
最近听得较多的跳槽、面试之类的,相信很多园友也开始蠢蠢欲动了,有的甚至早已经开始了。最近我也在琢磨着换工作的事。说得俗套点,人在外面不就为了那么点工资么。现在找工作大部分都是通过在网上投简历,然后等电话 通知面试的。然,现在的招聘网站也是比较多。一个一个的在各大网站切换的流量招聘信息 实属麻烦。之前看到过一篇博文。《 找工作神器,提取各大网站有效的招聘信息(前程无忧、智联招聘、猎聘网) 》感觉这想法挺好的。把各大网站信息集中起来浏览,第一省了来回切换,第二还不容易重复投简历。本想拿来用用的,无奈没有提供源码下载,且是客户端版本。于是就只能自己动手,丰衣足食了~。(网站就是强大,可以大家一起分享●0●^_^) 合并查询本来就是为了简单方便,所以也就没有弄很复杂了,一个页面搞定。如果同学们有什么好的想法,可以建议建议。 效果图: 就一个简单的关键字输入框、工作地点的选择和信息来源网站。 其实看上去很简单,实现起来也很简单。~~代码不多,难度也很小。很多时候需要的技术不是很多,想法更重要。 不想往下看的可以直接用用 演示地址 ,同学们求工作给推荐推荐,上海 浦东 .net。 私密我,或Q我。 第一、分析url 进入招聘网站的时候url大串大串的,我们需要用的的就三个。搜索关键字、地址和页码。 智联招聘: http://sou.zhaopin.com/jobs/searchresult

JavaScript--获取页面盒子中鼠标相对于盒子上、左边框的坐标

末鹿安然 提交于 2019-11-27 10:07:38
分析: 外层边框是浏览器边框,内部盒子是页面的一个盒子,绿点是盒子中鼠标的位置。鼠标相对盒子边框的坐标=页面中(注意不是浏览器)鼠标坐标-盒子相对于浏览器边框的偏移量 第一步:求浏览器边框位置 x=element.offsetLeft; y=element.offsetTop; 代码如下: 1 /*************样式表********************/ 2 <style> 3 *{ 4 padding: 0px; 5 margin: 0px; 6 } 7 body { 8 height: 2000px; 9 } 10 #box{ 11 border: 1px solid black; 12 margin: 100px; 13 width: 400px; 14 height: 400px; 15 } 16 </style> 17 18 19 /*************网页主体********************/ 20 <body> 21 <div id="box"></div> 22 /*************JS代码********************/ 23 <script> 24 //获取盒子边框相当于浏览器边框的距离 25 var box=document.getElementById('box'); 26 var x=box

如何实现图片懒加载

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 08:49:04
一、什么是懒加载 将图片src先赋值为一张默认图片,当用户滚动滚动条到可视区域图片的时候,再去加载后续真正的图片 如果用户只对第一张图片感兴趣,那剩余的图片请求就可以节省了 二、为什么要引入懒加载 懒加载(LazyLoad)是前端优化的一种有效方式,极大的提升用户体验。图片一直是页面加载的流浪大户,现在一张图片几兆已经是很正常的事,远远大于代码的大小。倘若一次ajax请求10张图片的地址,一次性把10张图片都加载出来,肯定是不合理的。 三、懒加载中涉及的属性 1 、 document.documentElement.clientHeight; //表示浏览器可见区域高度: document.body.clientHeight //是整个页面内容的高度,而非浏览器可见区域的高度 2 、document.documentElement.scrollTop; //滚动条 已滚动的高度: chrome 中 document.body.scrollTop //滚动条 滚过的高度 那么要得到滚动条的高度:有一个技巧:   var scrollTop=document.body.scrollTop || document.documentElement.scrollTop;   这两个值总会有一个恒为0,所以不用担心会对真正的scrollTop造成影响。一点小技巧,但很实用。 3、

原生js获取scrollTop

a 夏天 提交于 2019-11-27 07:52:01
1、各浏览器下 scrollTop的差异 IE6/7/8: 对于没有doctype声明的页面里可以使用 document.body.scrollTop 来获取 scrollTop高度 ; 对于有doctype声明的页面则可以使用 document.documentElement.scrollTop; Safari: safari 比较特别,有自己获取scrollTop的函数 : window.pageYOffset ; Firefox: 火狐等等相对标准些的浏览器就省心多了,直接用 document.documentElement.scrollTop ; 2、 获取scrollTop值 完美的获取scrollTop 赋值短语 : var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; 来源: https://www.cnblogs.com/lgnblog/p/11352046.html

$(document).scrollTop() always returns 0

徘徊边缘 提交于 2019-11-27 07:43:49
I'm simply trying to do something once the scroll position of the page reaches a certain height. However scrollTop() is returning 0 or null no matter how far down I scroll. This is the help function I'm using to check the scrollTop() value: $('body').click(function(){ var scrollPost = $(document).scrollTop(); alert(scrollPost); }); I've tried attaching scrollTop() to $('body') , $('html') and of course $(window) , but nothing changes. Any ideas? For some reason, removing 'height: 100%' from my html and body tags fixed this issue. I hope this helps someone else! I had same problem with scroll =

How do I get the offset().top value of an element without using jQuery?

删除回忆录丶 提交于 2019-11-27 07:33:18
I'm programming a single-page application using the Angular framework. I'm new to it. I've read this guide to help me understand the fundamental differences between jQuery and Angular and I'd like to follow this guidance as much as possible and NOT use jQuery. Except that jQuery helps get around some of the browser incompatibilities and provides a useful library of functions, like being able to know the top position of an element from the top of the window, as in $('element').offset().top . No plain Javascript seems to be able to come close without rewriting this function, at which point

JS-盒子模型

让人想犯罪 __ 提交于 2019-11-27 07:12:22
JS-盒子模型 offset属性 scroll属性 body兼容问题 client属性 body兼容问题 offset属性 属性 offsetWidth / offsetHeight border+padding+width offsetLeft / offsetTop margin+fater’s padding(fater需有定位,若没有则以body为fater) offsetParent 获取 定位!=static 的父对象(若父对象都没定位则返回body) scroll属性 scroll用于获取带(不带也可以)滚动条盒子的尺寸信息 属性 scrollWidth / scrollHeight padding+width scrollTop / scrollLeft 超出部分的(padding+width) body兼容问题 body的scrollTop/scrollLeft存在兼容性问题,除body外的其他元件没有兼容问题 文档没有DTD声明时用: document . body . scrollTop document . body . scrollLeft 文档有DTD声明时用: document . documentElement . scrollTop document . documentElement . scrollLeft 无视DTD声明的写法(谷歌、火狐

Choppy/Laggy scroll event on Chrome and IE

拜拜、爱过 提交于 2019-11-27 06:49:30
I am trying to have a content block always be shown to the user, even if he scrolls way down the page. He should also be able to scroll up and down the content block. Here is a fiddle with a stripped down version to show you what I mean: http://jsfiddle.net/9ehfV/2/ One should notice when scrolling down, until reaching the bottom of the red block, it will fix the block on the window, and when scrolling back up, it places it back. In Firefox one can scroll up and down and the fixing/unfixing described above is imperceptible – smooth as silk. Once one tries scrolling in Chrome or IE, though, it

Run ScrollTop with offset of element by ID

橙三吉。 提交于 2019-11-27 05:23:51
问题 Trying to make the browser scroll to a specific ID with an added offset - $('html, body').animate({scrollTop: $('#contact').offset().top}, 'slow'); What I need to do is to set the offset by -100px. How can I accomplish this? 回答1: No magic involved, just subtract from the offset top of the element $('html, body').animate({scrollTop: $('#contact').offset().top -100 }, 'slow'); 回答2: var top = ($(".apps_intro_wrapper_inner").offset() || { "top": NaN }).top; if (!isNaN(top)) { $("#app_scroler")

;Jquery: animate page down 100px from current screen position

不羁的心 提交于 2019-11-27 02:03:54
问题 I need to animate a scroll from the current screen position, down a set number of pixels. $('html,body').animate({ scrollTop: $(window).position().top += 100 }); or? $('html,body').animate({ scrollTop: '+=100px' }); 回答1: Just change: scrollTop: $('body').position().top += 100 To this: scrollTop: $(window).scrollTop() + 100 See demo: http://jsfiddle.net/fpxuC/ 回答2: Check out the jQuery.ScrollTo plugin. You can do something like: $(...).scrollTo( '+=100px', 800 ); Check out the sample for