-
Notifications
You must be signed in to change notification settings - Fork 0
/
elementsJs.js
41 lines (34 loc) · 1019 Bytes
/
elementsJs.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
'use strict';
function btnActive() {
if ($(window).scrollTop() > $(window).outerHeight()) $('.goTop').fadeIn(500);
else $('.goTop').fadeOut(500);
}
$(document).ready(function () {
//==========кнопка скролл вверх================
btnActive();
$(window).on('scroll', btnActive);
$('.goTop').click(function () {
$('html').animate(
{
scrollTop: $('#top').offset().top,
},
500
);
});
$(".selectDiv").on("click", function () {
$(".ul").slideToggle(100);
$(".arrowIcon").toggleClass("rotate");
return false;
});
let placeholder = document.querySelector('.wideSearch>input').getAttribute('placeholder');
document
.querySelector(".wideSearch>input")
.addEventListener("focus", function (event) {
event.target.setAttribute("placeholder", "");
});
document
.querySelector(".wideSearch>input")
.addEventListener("blur", function (event) {
event.target.setAttribute("placeholder", placeholder);
});
});