-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuserhead.js
38 lines (32 loc) · 963 Bytes
/
userhead.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
$(function () {
// прогрузка баланса и аватарки
$.post('../../scripts/getUserHeadInfo.php', {}, function (data) {
result = JSON.parse(data);
stats = result.data;
if (result.success == 1) {
$('#balance').text(stats.balance);
$('.profile-pic').attr('src', stats.profile_picture);
}
else {
alert("Ты как сюда попал?");
window.location.href = '../../main/main.html';
}
});
// наводка на блок профиля
let hoverTimeOut;
$('.profile-pic').hover(function () {
clearTimeout(hoverTimeOut);
$('.dropdown').stop(true, true).slideDown(200);
}, function () {
hoverTimeOut = setTimeout(function () {
$('.dropdown').stop(true, true).slideUp(200);
}, 200);
});
$('.dropdown').mouseleave(function () {
hoverTimeOut = setTimeout(function () {
$('.dropdown').stop(true, true).slideUp(200);
}, 200);
}).mouseenter(function () {
clearTimeout(hoverTimeOut);
});
});