-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
60 lines (48 loc) · 1.77 KB
/
main.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
window.onbeforeunload = function () {
window.scrollTo(0, 0);
}
$(function(){
$( ".downArrow" ).click(function() {
$('html, body').animate({
scrollTop: $("#mainBody1").offset().top
}, 1500);
});
});
$('.imageLeft').click(function() {
var index = this.getAttribute("data-index");
var descr = ".description" + index;
console.log( descr);
$(String(descr)).css('visibility','visible').animate({
opacity: 1
},500);
});
$('.close').click(function() {
var index = this.getAttribute("alt");
var descr = ".description" + index;
console.log( "mo chiudo" + descr);
$(String(descr)).animate({
opacity: 0
},500, function(){
$(String(descr)).css('visibility','hidden');
});
});
$('.owl-carousel, carouselImages').on('click', '.owl-item', function () {
console.log("click");
var index = this.getAttribute("data-img");
var descr = this.getAttribute("data-desc");
console.log(index);
var descr= ".description" + descr;
console.log(descr);
$(String(descr)).prepend('<div style="z-index: 1 vertical-align: middle; text-align: center; position:absoulte; top:0; left:0; right:0; height: 500px; background-color: black;"> <img class="closeFull" style="position:absolute; top: 3%; left:3%;" src="icons/close.png"> <img style=" margin-top: 3%; width: 60%;" src="images/elle_king/1.jpg" ></div>');
$('.closeFull').click(function () {
$(this).parent('div').remove();
});
});
$(document).ready(function(){
$('.owl-carousel').owlCarousel({
autoplay: true,
loop:true,
items: 5,
margin: 2,
})
});