scritps.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. function jcarousel() {
  2. $('.owl-carousel').owlCarousel({
  3. margin:40,
  4. loop:true,
  5. autoWidth:true,
  6. items:8,
  7. nav: true
  8. });
  9. }
  10. function scrollHeader() {
  11. var $Header = $('header .title');
  12. $(window).scroll(function() {
  13. var scroll = $(window).scrollTop();
  14. if (scroll >= 500) {
  15. $Header.addClass("Hc");
  16. } else {
  17. $Header.removeClass("Hc");
  18. }
  19. });
  20. }
  21. function open() {
  22. var $pk = $('.why_lsdo > h3');
  23. var $answer = $('.why_lsdo ');
  24. $pk.click(function() {
  25. if ($('.why_lsdo').hasClass('open')){
  26. $('.why_lsdo').removeClass('open');
  27. $('.why_lsdo').addClass('close');
  28. } else {
  29. $('.why_lsdo').removeClass('close');
  30. $('.why_lsdo').addClass('open');
  31. }
  32. });
  33. }
  34. function scrollbar() {
  35. $(window).on("load",function(){
  36. $(".col-12").mCustomScrollbar();
  37. });
  38. }
  39. function scrollNav() {
  40. $('.navbar a').click(function(){
  41. //Toggle Class
  42. $(".active").removeClass("active");
  43. $(this).closest('li').addClass("active");
  44. var theClass = $(this).attr("class");
  45. // $('.'+theClass).parent('li').addClass('active');
  46. //Animate
  47. $('html, body').stop().animate({
  48. scrollTop: $( $(this).attr('href') ).offset().top - 140
  49. }, 400);
  50. return false;
  51. });
  52. $('.scrollTop a').scrollTop();
  53. }
  54. function navFooter() {
  55. var $Fs = $('footer section');
  56. $Fs.hide();
  57. $('footer a[href^="#"]').on('click', function(event) {
  58. var target = $(this.getAttribute('href'));
  59. if( target.length ) {
  60. event.preventDefault();
  61. target.slideToggle();
  62. $('html, body').stop().animate({
  63. scrollTop: target.offset().top
  64. }, 1000);
  65. }
  66. });
  67. }
  68. jQuery(document).ready(function($){
  69. scrollNav();
  70. scrollHeader();
  71. jcarousel();
  72. open();
  73. scrollbar();
  74. navFooter();
  75. });