main.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /* ---------------------------------------------------
  2. Template Name: Sona
  3. Description: Sona Hotel Html Template
  4. Author: Colorlib
  5. Author URI: https://colorlib.com
  6. Version: 1.0
  7. Created: Colorlib
  8. --------------------------------------------------------- */
  9. 'use strict';
  10. (function ($) {
  11. /*------------------
  12. Preloader
  13. --------------------*/
  14. $(window).on('load', function () {
  15. $(".loader").fadeOut();
  16. $("#preloder").delay(200).fadeOut("slow");
  17. });
  18. /*------------------
  19. Background Set
  20. --------------------*/
  21. $('.set-bg').each(function () {
  22. var bg = $(this).data('setbg');
  23. $(this).css('background-image', 'url(' + bg + ')');
  24. });
  25. //Offcanvas Menu
  26. $(".canvas-open").on('click', function () {
  27. $(".offcanvas-menu-wrapper").addClass("show-offcanvas-menu-wrapper");
  28. $(".offcanvas-menu-overlay").addClass("active");
  29. });
  30. $(".canvas-close, .offcanvas-menu-overlay").on('click', function () {
  31. $(".offcanvas-menu-wrapper").removeClass("show-offcanvas-menu-wrapper");
  32. $(".offcanvas-menu-overlay").removeClass("active");
  33. });
  34. // Search model
  35. $('.search-switch').on('click', function () {
  36. $('.search-model').fadeIn(400);
  37. });
  38. $('.search-close-switch').on('click', function () {
  39. $('.search-model').fadeOut(400, function () {
  40. $('#search-input').val('');
  41. });
  42. });
  43. /*------------------
  44. Navigation
  45. --------------------*/
  46. $(".mobile-menu").slicknav({
  47. prependTo: '#mobile-menu-wrap',
  48. allowParentLinks: true
  49. });
  50. /*------------------
  51. Hero Slider
  52. --------------------*/
  53. $(".hero-slider").owlCarousel({
  54. loop: true,
  55. margin: 0,
  56. items: 1,
  57. dots: true,
  58. animateOut: 'fadeOut',
  59. animateIn: 'fadeIn',
  60. smartSpeed: 1200,
  61. autoHeight: false,
  62. autoplay: true,
  63. mouseDrag: false
  64. });
  65. /*------------------------
  66. Testimonial Slider
  67. ----------------------- */
  68. $(".testimonial-slider").owlCarousel({
  69. items: 1,
  70. dots: false,
  71. autoplay: true,
  72. loop: true,
  73. smartSpeed: 1200,
  74. nav: true,
  75. navText: ["<i class='arrow_left'></i>", "<i class='arrow_right'></i>"]
  76. });
  77. /*------------------
  78. Magnific Popup
  79. --------------------*/
  80. $('.video-popup').magnificPopup({
  81. type: 'iframe'
  82. });
  83. /*------------------
  84. Date Picker
  85. --------------------*/
  86. $(".date-input").datepicker({
  87. minDate: 0,
  88. dateFormat: 'dd MM, yy'
  89. });
  90. /*------------------
  91. Nice Select
  92. --------------------*/
  93. $("select").niceSelect();
  94. })(jQuery);