-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
83 lines (70 loc) · 2.45 KB
/
script.js
File metadata and controls
83 lines (70 loc) · 2.45 KB
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
$(document).ready(function() {
// OWL CAROUSEL INSTALLATION
$("#testimonial-carousel").owlCarousel({
items:1,
itemsDesktop : [1000,1], //5 items between 1000px and 901px
itemsDesktopSmall : [900,1], // betweem 900px and 601px
itemsTablet: [600,1],
itemsMobile :[479,1],
pagination:true
});
$("#home-slider").owlCarousel({
items:1,
itemsDesktop : [1000,1], //5 items between 1000px and 901px
itemsDesktopSmall : [900,1], // betweem 900px and 601px
itemsTablet: [600,1],
itemsMobile :[479,1],
pagination:false,
navigation:true,
navigationText:["<i class='ion-ios-arrow-left'></i>","<i class='ion-ios-arrow-right'></i>"]
});
/* Navigation Menu*/
var offsettop = $('.navbar').offset().top;
if (offsettop > 50) {
$('.navbar').addClass('colored-nav');
$('.navbar').addClass('gradient-violat');
$("#scroll-top-div").fadeIn('500');
} else {
$('.navbar').removeClass('colored-nav');
$('.navbar').removeClass('gradient-violat');
$("#scroll-top-div").fadeOut('500');
}
var num = 50; //number of pixels before modifying styles
$(window).bind('scroll', function () {
if ($(window).scrollTop() > num) {
$('.navbar').addClass('colored-nav');
$('.navbar').addClass('gradient-violat');
$("#scroll-top-div").fadeIn('500');
} else {
$('.navbar').removeClass('colored-nav');
$('.navbar').removeClass('gradient-violat');
$("#scroll-top-div").fadeOut('500');
}
});
/* SMOOTH SCROLLING SCRIPT*/
// Add smooth scrolling to all links
$(".navbar-nav li a").on('click', function(event) {
// Make sure this.hash has a value before overriding default behavior
if (this.hash !== "") {
// Prevent default anchor click behavior
event.preventDefault();
// Store hash
var hash = this.hash;
// Using jQuery's animate() method to add smooth page scroll
// The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
$('html, body').animate({
scrollTop: $(hash).offset().top
}, 800, function(){
// Add hash (#) to URL when done scrolling (default click behavior)
window.location.hash = hash;
});
} // End if
});
/****************************BACK TO TOP************************************/
$('#scroll-top-div').on('click', function (e) {
e.preventDefault();
$('html,body').animate({
scrollTop: 0
}, 700);
});
});