Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/StaticMania/roxo-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/script.js')
-rw-r--r--assets/js/script.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/assets/js/script.js b/assets/js/script.js
new file mode 100644
index 0000000..3ccf32b
--- /dev/null
+++ b/assets/js/script.js
@@ -0,0 +1,35 @@
+$(document).ready(function() {
+ "use strict";
+ // Scroll to top
+ $("a[href='#top']").click(function() {
+ $("html, body").animate({ scrollTop: 0 }, "slow");
+ return false;
+ });
+
+ // Smooth scroll
+ $('a.scroll-to').on('click', function (event) {
+ var $anchor = $(this);
+ $('html, body').stop().animate({
+ scrollTop: ($($anchor.attr('href')).offset().top - 50)
+ }, 700);
+ event.preventDefault();
+ });
+
+ $('.site-testimonial-item').on('mouseenter', function(){
+ $('.site-testimonial-item').addClass('inactive');
+ $(this).removeClass('inactive').addClass('active');
+ });
+ $('.site-testimonial-item').on('mouseleave', function(){
+ $('.site-testimonial-item').removeClass('inactive');
+ $('.site-testimonial-item').removeClass('active');
+ });
+});
+
+$(window).on('scroll', function () {
+ var windscroll = $(window).scrollTop();
+ if (windscroll >= 100) {
+ $('.site-navigation').addClass('nav-bg');
+ } else {
+ $('.site-navigation').removeClass('nav-bg');
+ }
+});