ab_cab.js
4.94 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
$(document).ready(function(){
notice()
menuFix()
newPass()
fixHeightFormsWr()
ordersExpand()
ieFixPgnavi()
helpTitle()
function notice() {
var flag = false;
var animTime = 250
var liSideBare = $('.box_side-notice ul li')
var ulSideBare = $('.box_side-notice ul')
var ulHeight = $('.box_side-notice ul').height()
if(ulHeight>210) {
startNotice()
}
function startNotice() {
$('.arrows_down').addClass('on_arrows')
$(liSideBare[0]).addClass('active_li')
var fullHeight=0;
$(liSideBare).each(function(){
fullHeight+=$(this).height();
});
function nextClick(object) {
if (flag) return false;
flag = true;
var activeLi = $('.active_li')
if(activeLi.index()<(liSideBare.length)-1) {
$('.arrows_up').addClass('on_arrows')
var margin = ulSideBare.css('marginTop')
margin = margin.replace('px','')
margin=+margin
margin+=-((activeLi.height())+2)
// console.log(margin+ulHeight+'/')
if((margin+ulHeight)>150){
$(ulSideBare).animate({marginTop:margin},animTime)
activeLi.removeClass('active_li').next().addClass('active_li')
if((activeLi.index())==(liSideBare.length)-4){
console.log($(this))
$(object).removeClass('on_arrows')
}
}
}
setTimeout(function(){
flag = false;
},animTime)
}
function prevClick(object) {
if (flag) return false;
flag = true;
var activeLi = $('.active_li')
if(activeLi.index()<(liSideBare.length)-1 && activeLi.index()>0) {
$('.arrows_down').addClass('on_arrows')
var margin = ulSideBare.css('marginTop')
margin = margin.replace('px','')
margin=+margin
margin+=((activeLi.prev().height())+2)
if((activeLi.index())==(liSideBare.length)-6){
$(object).removeClass('on_arrows')
}
if((margin+ulHeight)>150){
$(ulSideBare).animate({marginTop:margin},animTime)
activeLi.removeClass('active_li').prev().addClass('active_li')
}
}
setTimeout(function(){
flag = false;
},animTime)
}
$('.arrows_down').click(function () {
nextClick(this)
})
$('.arrows_up').click(function () {
prevClick(this)
})
}
addBlur()
function addBlur() {
$('.box_side-notice li').hover(function () {
$('.box_side-notice li').addClass('blur')
$(this).removeClass('blur')
}, function () {
$('.box_side-notice li').removeClass('blur')
})
}
}
function menuFix() {
var menuLi = $('.artbox_cab-menu-wr ul li')
var menuLiLenght = (menuLi.length)-1
$(menuLi[menuLiLenght]).addClass('last-child')
}
function newPass() {
$('.change_pass_ a').click(function () {
$(this).parents('.change_pass_').remove()
$('.input-blocks._hidden_pass').removeClass('_hidden_pass')
})
}
function fixHeightFormsWr() {
var sidebareHeight = $('.artbox_cab-sidebar-wr').height()
var menuHeight = $('.artbox_cab-menu-wr').height()
if(sidebareHeight>=menuHeight) {
$('.artbox_cab-forms-wr').css({minHeight:sidebareHeight})
} else {
$('.artbox_cab-forms-wr').css({minHeight:menuHeight})
}
}
function ordersExpand() {
$('._order_num span').click(function () {
$(this).parents('._orders').toggleClass('active')
})
}
function ieFixPgnavi() {
var li = $('.pgnavi_wr ul li')
var liLenght = (li.length)-1
$(li[liLenght]).addClass('last_li')
}
function helpTitle() {
var timeOut = setTimeout(function () {
},100)
$('._personal_title_link a').hover(function (e) {
var title = $(this).data('title')
var thisBlock = $(this).parents('._personal_data')
timeOut = setTimeout(function () {
thisBlock.append('<div class="_data_title">'+title+'</div>')
},700)
}, function () {
})
$('._personal_data').mouseleave(function () {
$('._data_title').remove()
clearTimeout(timeOut);
})
}
});