mains.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. /* ========================================================================= */
  2. /* Preloader
  3. /* ========================================================================= */
  4. jQuery(window).load(function(){
  5. $("#preloader").fadeOut("slow");
  6. // 帮助中心
  7. // $(".bz-right-conent>div").eq(0).show()
  8. // let abtn = $(".bz-ul").children('li').click(function(){
  9. // var _index = $(this).index();
  10. // //让内容框的第 _index 个显示出来,其他的被隐藏
  11. // $(".bz-right-conent>div").eq(_index).show().siblings().hide();
  12. // $(this).addClass("active").siblings().removeClass('active')
  13. // });
  14. });
  15. /* ========================================================================= */
  16. /* Welcome Section Slider
  17. /* ========================================================================= */
  18. $(function() {
  19. var Page = (function() {
  20. var $navArrows = $( '#nav-arrows' ),
  21. $nav = $( '#nav-dots > span' ),
  22. slitslider = $( '#slider' ).slitslider( {
  23. onBeforeChange : function( slide, pos ) {
  24. $nav.removeClass( 'nav-dot-current' );
  25. $nav.eq( pos ).addClass( 'nav-dot-current' );
  26. }
  27. } ),
  28. init = function() {
  29. initEvents();
  30. },
  31. initEvents = function() {
  32. // add navigation events
  33. $navArrows.children( ':last' ).on( 'click', function() {
  34. slitslider.next();
  35. return false;
  36. } );
  37. $navArrows.children( ':first' ).on( 'click', function() {
  38. slitslider.previous();
  39. return false;
  40. } );
  41. $nav.each( function( i ) {
  42. $( this ).on( 'click', function( event ) {
  43. var $dot = $( this );
  44. if( !slitslider.isActive() ) {
  45. $nav.removeClass( 'nav-dot-current' );
  46. $dot.addClass( 'nav-dot-current' );
  47. }
  48. slitslider.jump( i + 1 );
  49. return false;
  50. } );
  51. } );
  52. };
  53. return { init : init };
  54. })();
  55. Page.init();
  56. });
  57. $(document).ready(function(){
  58. /* ========================================================================= */
  59. /* Portfolio
  60. /* ========================================================================= */
  61. var $projectWrapper = $('.project-wrapper');
  62. $projectWrapper.isotope({
  63. filter: '*',
  64. animationOptions: {
  65. duration: 750,
  66. easing: 'linear',
  67. queue: false
  68. }
  69. });
  70. $('.portfolio-filter a').click(function(){
  71. $('.portfolio-filter .active').removeClass('active');
  72. $(this).addClass('active');
  73. var selector = $(this).attr('data-filter');
  74. $projectWrapper.isotope({
  75. filter: selector,
  76. animationOptions: {
  77. duration: 750,
  78. easing: 'linear',
  79. queue: false
  80. }
  81. });
  82. return false;
  83. });
  84. /* ========================================================================= */
  85. /* Menu item highlighting
  86. /* ========================================================================= */
  87. // jQuery('#nav').singlePageNav({
  88. // offset: jQuery('#nav').outerHeight(),
  89. // filter: ':not(.external)',
  90. // speed: 2000,
  91. // currentClass: 'current',
  92. // easing: 'easeInOutExpo',
  93. // updateHash: true,
  94. // beforeStart: function() {
  95. // console.log('begin scrolling');
  96. // },
  97. // onComplete: function() {
  98. // console.log('done scrolling');
  99. // }
  100. // });
  101. $(window).scroll(function () {
  102. if ($(window).scrollTop() > 10) {
  103. $(".navbar-brand a").css("color","#fff");
  104. $("#navigation").removeClass("animated-header");
  105. } else {
  106. $(".navbar-brand a").css("color","inherit");
  107. $("#navigation").addClass("animated-header");
  108. }
  109. });
  110. /* ========================================================================= */
  111. /* Fix Slider Height
  112. /* ========================================================================= */
  113. // Slider Height
  114. var slideHeight = $(window).height();
  115. $('#home-slider, #slider, .sl-slider, .sl-content-wrapper').css('height',slideHeight);
  116. $(window).resize(function(){'use strict',
  117. $('#home-slider, #slider, .sl-slider, .sl-content-wrapper').css('height',slideHeight);
  118. });
  119. $("#works, #testimonial").owlCarousel({
  120. navigation : true,
  121. pagination : false,
  122. slideSpeed : 700,
  123. paginationSpeed : 400,
  124. singleItem:true,
  125. navigationText: ["<i class='fa fa-angle-left fa-lg'></i>","<i class='fa fa-angle-right fa-lg'></i>"]
  126. });
  127. /* ========================================================================= */
  128. /* Featured Project Lightbox
  129. /* ========================================================================= */
  130. $(".fancybox").fancybox({
  131. padding: 0,
  132. openEffect : 'elastic',
  133. openSpeed : 650,
  134. closeEffect : 'elastic',
  135. closeSpeed : 550,
  136. closeClick : true,
  137. beforeShow: function () {
  138. this.title = $(this.element).attr('title');
  139. this.title = '<h3>' + this.title + '</h3>' + '<p>' + $(this.element).parents('.portfolio-item').find('img').attr('alt') + '</p>';
  140. },
  141. helpers : {
  142. title : {
  143. type: 'inside'
  144. },
  145. overlay : {
  146. css : {
  147. 'background' : 'rgba(0,0,0,0.8)'
  148. }
  149. }
  150. }
  151. });
  152. });
  153. // ========== END GOOGLE MAP ========== //
  154. var wow = new WOW ({
  155. offset: 75, // distance to the element when triggering the animation (default is 0)
  156. mobile: false, // trigger animations on mobile devices (default is true)
  157. });
  158. wow.init();