init.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. $(document).ready(function() {
  2. $(window).scroll(function() {
  3. var nav_img = $('.navbar-brand img');
  4. if ($(document).scrollTop() < 130) {
  5. $('nav').addClass('transparent');
  6. nav_img.attr("src","img/biotherm-white-dots.png");
  7. } else {
  8. $('nav').removeClass('transparent').css('color: black');
  9. nav_img.attr("src","img/biotherm-black-dots.png");
  10. }
  11. });
  12. if (window.location.hash) {
  13. var hash = window.location.hash;
  14. $('html, body').animate({
  15. scrollTop : $(hash).offset().top
  16. }, 500);
  17. };
  18. });
  19. $(document).on('click', '[data-toggle="lightbox"]', function(event) {
  20. event.preventDefault();
  21. $(this).ekkoLightbox();
  22. });
  23. $(function() {
  24. $("img.lazy").lazyload();
  25. });
  26. $('.imageHoverLoad').mouseenter(function() {
  27. var elem = $(this);
  28. elem.fadeOut(400).promise().done(function() {
  29. elem.attr('src', elem.attr('data-hover')).fadeIn(400);
  30. });
  31. });
  32. $('.imageHoverLoad').mouseleave(function() {
  33. var elem = $(this);
  34. elem.fadeOut(400).promise().done(function() {
  35. elem.attr('src', elem.attr('data-original')).fadeIn(400);
  36. });
  37. });
  38. $('#front-carousel').carousel({
  39. interval: 8000
  40. });