-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
92 lines (80 loc) · 2.16 KB
/
script.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
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
document.addEventListener("DOMContentLoaded", function() {
// document.querySelector(".open").addEventListener(
// "click",
// function(e) {
// this.classList.add("oppenned");
// e.stopPropagation();
// },
// false
// );
// document.querySelector("body").addEventListener(
// "click",
// function() {
// document.querySelector(".open").classList.remove("oppenned");
// },
// false
// );
// document.querySelector(".cls").addEventListener(
// "click",
// function(e) {
// document.querySelector(".open").classList.remove("oppenned");
// e.stopPropagation();
// },
// false
// );
$(document).on("click", ".open", function(event) {
$(this).toggleClass("oppenned");
event.stopPropagation();
});
$(document).on("click", "body", function(event) {
$(".open").removeClass("oppenned");
});
$(".slick").slick({
centerMode: true,
centerPadding: "20px",
slidesToShow: 2,
arrows: true,
responsive: [
{
breakpoint: 970,
settings: {
arrows: true,
centerMode: true,
centerPadding: "0",
slidesToShow: 1,
autoplay: true,
autoplaySpeed: 4000
}
},
{
breakpoint: 480,
settings: {
arrows: false,
dots: true,
centerMode: true,
centerPadding: "0",
slidesToShow: 1
}
}
]
});
var ua = navigator.userAgent;
var start = "mousedown";
var move = "mousemove";
var end = "mouseup";
var ink, d, x, y;
$(".ripplelink, .slick-arrow").on(start, function(e) {
if ($(this).find(".ink").length === 0) {
$(this).prepend("<span class='ink'></span>");
}
ink = $(this).find(".ink");
ink.removeClass("animate");
if (!ink.height() && !ink.width()) {
d = Math.max($(this).outerWidth(), $(this).outerHeight());
ink.css({ height: d, width: d });
}
x = e.originalEvent.pageX - $(this).offset().left - ink.width() / 2;
y = e.originalEvent.pageY - $(this).offset().top - ink.height() / 2;
ink.css({ top: y + "px", left: x + "px" }).addClass("animate");
});
});