-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfunctions.js
More file actions
47 lines (38 loc) · 962 Bytes
/
Copy pathfunctions.js
File metadata and controls
47 lines (38 loc) · 962 Bytes
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
$(document).ready(function(){
$('.main-carousel').flickity({
cellAlign: 'left',
wrapAround: true,
prevNextButtons: false
});
});
function buttonClick(){
window.alert("Thank you for Subscribing");
}
function addToCart(){
var cartItems = document.getElementById('cartItems');
cartItems.setAttribute("style", "display:block");
var number = parseInt(cartItems.innerHTML);
++number;
cartItems.innerHTML = number;
}
var marginY= 0;
var destination = 0;
var speed = 5;
var scroller = null;
var windowScrollTop =0;
function initScroll(elementId){
destination = document.getElementById(elementId).offsetTop;
destination = destination - 102;
scroller = setTimeout(function(){
initScroll(elementId);
}, 1);
marginY = marginY + speed;
if(marginY>=destination){
clearTimeout(scroller);
marginY = 0;
}
if(marginY!=0){
window.scroll(0, marginY);}
{
}
}