-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.js
55 lines (49 loc) · 1.33 KB
/
index.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
$(document).ready(function() {
$(".parallax").parallax();
var options = [{
selector: '#staggeredList',
offset: 300,
callback: function(el) {
Materialize.showStaggeredList($(el));
}
}, ];
Materialize.scrollFire(options);
$('.carousel.carousel-slider').carousel({
fullWidth: true,
indicators: true,
numVisible: 1,
});
// move next carousel
$('.moveNextCarousel').click(function(e){
e.preventDefault();
e.stopPropagation();
$('.carousel').carousel('next');
});
// move prev carousel
$('.movePrevCarousel').click(function(e){
e.preventDefault();
e.stopPropagation();
$('.carousel').carousel('prev');
});
// Scrolltop button
$(window).scroll(function () {
if ($(document).height() > 1000 && $(window).scrollTop() > $(".navbar-fixed").outerHeight()) {
$("#scrolltop").fadeIn();
} else {
$("#scrolltop").fadeOut();
}
})
$("#scrolltop").click(function () {
$("html, body").animate({
scrollTop: 0
}, 1000);
});
});
function brokenImage(link, id) {
var image = document.getElementById(id + 'new');
var old = document.getElementById(id);
sub = "<img src='" + link + "' alt='background picture showing a view of Vienna' />";
image.innerHTML = sub;
image.style.display = "inline";
old.style.display = "none";
};