-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
62 lines (57 loc) · 1.6 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
$(function(){
var li = $('.ban li');
var ban = $('.ban');
var em =$('.ban-ctr em');
var ctr=$('.ban-ctr li');
var i= 0;
ctr.on('mouseover',function(){
i = $(this).index() ;
ban.stop();
em.stop();
var index = - i * 165;
var emindex = i*52;
ban.animate({
top:index
});
em.animate({
top:emindex
});
})
setInterval(function(){
var index = - i * 165;
var emindex = i*52;
ban.animate({
top:index
});
em.animate({
top:emindex
});
i++;
if(i>2){
i = 0;
}
},3000)
$('input').on('click',function(){
$(this).attr('placeholder','请输入职位名称或公司名称');
})
$('input').on('blur',function(){
$(this).attr('placeholder','视觉设计');
})
var leftLi = $('.content-left li');
var lastI = leftLi.last();
for(var j = 0;j<leftLi.length;j++){
if(j!=0) {
leftLi.eq(j).on('mouseover', function () {
var divH = $(this).find('div').height();
var iH = $(this).height();
$(this).find('div').css('top', -iH / 2);
$(this).find('span').css('height', $(this).height());
var topAndDiv =$(this).find('div').offset().top+divH;
var iAndtop = lastI.offset().top+ lastI.height() ;
if(topAndDiv >iAndtop){
$(this).find('div').css('top',-(divH -lastI.height())+20);
}
})
}
}
});