custom.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. /*global jQuery:false */
  2. jQuery(document).ready(function($) {
  3. "use strict";
  4. //add some elements with animate effect
  5. $(".big-cta").hover(
  6. function () {
  7. $('.cta a').addClass("animated shake");
  8. },
  9. function () {
  10. $('.cta a').removeClass("animated shake");
  11. }
  12. );
  13. $(".box").hover(
  14. function () {
  15. $(this).find('.icon').addClass("animated fadeInDown");
  16. //$(this).find('p').addClass("animated fadeInUp");
  17. },
  18. function () {
  19. $(this).find('.icon').removeClass("animated fadeInDown");
  20. //$(this).find('p').removeClass("animated fadeInUp");
  21. }
  22. );
  23. /*Clients Slider*/
  24. if ($('#clients-slider').length){
  25. var owlClient = $("#clients-slider");
  26. owlClient.owlCarousel({
  27. autoPlay: 5000,
  28. items : 9, //10 items above 1000px browser width
  29. itemsDesktop : [1000,6], //5 items between 1000px and 901px
  30. itemsDesktopSmall : [900,5], // betweem 900px and 601px
  31. itemsTablet: [600,4], //2 items between 600 and 0
  32. itemsMobile : [400,3] // itemsMobile disabled - inherit from itemsTablet option
  33. });
  34. }
  35. // Custom Navigation Events
  36. $(".clients-slider .next").click(function(){
  37. owlClient.trigger('owl.next');
  38. })
  39. $(".clients-slider .prev").click(function(){
  40. owlClient.trigger('owl.prev');
  41. })
  42. $('.accordion').on('show', function (e) {
  43. $(e.target).prev('.accordion-heading').find('.accordion-toggle').addClass('active');
  44. $(e.target).prev('.accordion-heading').find('.accordion-toggle i').removeClass('icon-plus');
  45. $(e.target).prev('.accordion-heading').find('.accordion-toggle i').addClass('icon-minus');
  46. });
  47. $('.accordion').on('hide', function (e) {
  48. $(this).find('.accordion-toggle').not($(e.target)).removeClass('active');
  49. $(this).find('.accordion-toggle i').not($(e.target)).removeClass('icon-minus');
  50. $(this).find('.accordion-toggle i').not($(e.target)).addClass('icon-plus');
  51. });
  52. // tooltip
  53. $('.social-network li a, .options_box .color a').tooltip();
  54. // fancybox
  55. $(".fancybox").fancybox({
  56. padding : 0,
  57. autoResize: true,
  58. beforeShow: function () {
  59. this.title = $(this.element).attr('title');
  60. this.title = '<h4>' + this.title + '</h4>' + '<p>' + $(this.element).parent().find('img').attr('alt') + '</p>';
  61. },
  62. helpers : {
  63. title : { type: 'inside' },
  64. }
  65. });
  66. //scroll to top
  67. $(window).scroll(function(){
  68. if ($(this).scrollTop() > 100) {
  69. $('.scrollup').fadeIn();
  70. } else {
  71. $('.scrollup').fadeOut();
  72. }
  73. });
  74. $('.scrollup').click(function(){
  75. $("html, body").animate({ scrollTop: 0 }, 1000);
  76. return false;
  77. });
  78. $('#post-slider').flexslider({
  79. // Primary Controls
  80. controlNav : false, //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage
  81. directionNav : true, //Boolean: Create navigation for previous/next navigation? (true/false)
  82. prevText : "Previous", //String: Set the text for the "previous" directionNav item
  83. nextText : "Next", //String: Set the text for the "next" directionNav item
  84. // Secondary Navigation
  85. keyboard : true, //Boolean: Allow slider navigating via keyboard left/right keys
  86. multipleKeyboard : false, //{NEW} Boolean: Allow keyboard navigation to affect multiple sliders. Default behavior cuts out keyboard navigation with more than one slider present.
  87. mousewheel : false, //{UPDATED} Boolean: Requires jquery.mousewheel.js (https://github.com/brandonaaron/jquery-mousewheel) - Allows slider navigating via mousewheel
  88. pausePlay : false, //Boolean: Create pause/play dynamic element
  89. pauseText : 'Pause', //String: Set the text for the "pause" pausePlay item
  90. playText : 'Play', //String: Set the text for the "play" pausePlay item
  91. // Special properties
  92. controlsContainer : "", //{UPDATED} Selector: USE CLASS SELECTOR. Declare which container the navigation elements should be appended too. Default container is the FlexSlider element. Example use would be ".flexslider-container". Property is ignored if given element is not found.
  93. manualControls : "", //Selector: Declare custom control navigation. Examples would be ".flex-control-nav li" or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs.
  94. sync : "", //{NEW} Selector: Mirror the actions performed on this slider with another slider. Use with care.
  95. asNavFor : "", //{NEW} Selector: Internal property exposed for turning the slider into a thumbnail navigation for another slider
  96. });
  97. $('#main-slider').flexslider({
  98. namespace : "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin
  99. selector : ".slides > li", //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril
  100. animation : "fade", //String: Select your animation type, "fade" or "slide"
  101. easing : "swing", //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported!
  102. direction : "horizontal", //String: Select the sliding direction, "horizontal" or "vertical"
  103. reverse : false, //{NEW} Boolean: Reverse the animation direction
  104. animationLoop : true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
  105. smoothHeight : false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode
  106. startAt : 0, //Integer: The slide that the slider should start on. Array notation (0 = first slide)
  107. slideshow : true, //Boolean: Animate slider automatically
  108. slideshowSpeed : 7000, //Integer: Set the speed of the slideshow cycling, in milliseconds
  109. animationSpeed : 600, //Integer: Set the speed of animations, in milliseconds
  110. initDelay : 0, //{NEW} Integer: Set an initialization delay, in milliseconds
  111. randomize : false, //Boolean: Randomize slide order
  112. // Usability features
  113. pauseOnAction : true, //Boolean: Pause the slideshow when interacting with control elements, highly recommended.
  114. pauseOnHover : false, //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering
  115. useCSS : true, //{NEW} Boolean: Slider will use CSS3 transitions if available
  116. touch : true, //{NEW} Boolean: Allow touch swipe navigation of the slider on touch-enabled devices
  117. video : false, //{NEW} Boolean: If using video in the slider, will prevent CSS3 3D Transforms to avoid graphical glitches
  118. // Primary Controls
  119. controlNav : true, //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage
  120. directionNav : true, //Boolean: Create navigation for previous/next navigation? (true/false)
  121. prevText : "Previous", //String: Set the text for the "previous" directionNav item
  122. nextText : "Next", //String: Set the text for the "next" directionNav item
  123. // Secondary Navigation
  124. keyboard : true, //Boolean: Allow slider navigating via keyboard left/right keys
  125. multipleKeyboard : false, //{NEW} Boolean: Allow keyboard navigation to affect multiple sliders. Default behavior cuts out keyboard navigation with more than one slider present.
  126. mousewheel : false, //{UPDATED} Boolean: Requires jquery.mousewheel.js (https://github.com/brandonaaron/jquery-mousewheel) - Allows slider navigating via mousewheel
  127. pausePlay : false, //Boolean: Create pause/play dynamic element
  128. pauseText : 'Pause', //String: Set the text for the "pause" pausePlay item
  129. playText : 'Play', //String: Set the text for the "play" pausePlay item
  130. // Special properties
  131. controlsContainer : "", //{UPDATED} Selector: USE CLASS SELECTOR. Declare which container the navigation elements should be appended too. Default container is the FlexSlider element. Example use would be ".flexslider-container". Property is ignored if given element is not found.
  132. manualControls : "", //Selector: Declare custom control navigation. Examples would be ".flex-control-nav li" or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs.
  133. sync : "", //{NEW} Selector: Mirror the actions performed on this slider with another slider. Use with care.
  134. asNavFor : "", //{NEW} Selector: Internal property exposed for turning the slider into a thumbnail navigation for another slider
  135. });
  136. /* -------- Isotope Filtering -------- */
  137. if (document.getElementById("gallery-1")) {
  138. var $container = $('#isotope-gallery-container');
  139. var $filter = $('.filter');
  140. $(window).load(function () {
  141. // Initialize Isotope
  142. $container.isotope({
  143. itemSelector: '.gallery-item-wrapper'
  144. });
  145. $('.filter a').click(function () {
  146. var selector = $(this).attr('data-filter');
  147. $container.isotope({ filter: selector });
  148. return false;
  149. });
  150. $filter.find('a').click(function () {
  151. var selector = $(this).attr('data-filter');
  152. $filter.find('a').parent().removeClass('active');
  153. $(this).parent().addClass('active');
  154. });
  155. });
  156. $(window).smartresize(function () {
  157. $container.isotope('reLayout');
  158. });
  159. // End Isotope Filtering
  160. $('.gallery-zoom').magnificPopup({
  161. type: 'image'
  162. // other options
  163. });
  164. }
  165. });