main.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ;(function () {
  2. 'use strict';
  3. // Placeholder
  4. var placeholderFunction = function() {
  5. $('input, textarea').placeholder({ customClass: 'my-placeholder' });
  6. }
  7. // Placeholder
  8. var contentWayPoint = function() {
  9. var i = 0;
  10. $('.animate-box').waypoint( function( direction ) {
  11. if( direction === 'down' && !$(this.element).hasClass('animated-fast') ) {
  12. i++;
  13. $(this.element).addClass('item-animate');
  14. setTimeout(function(){
  15. $('body .animate-box.item-animate').each(function(k){
  16. var el = $(this);
  17. setTimeout( function () {
  18. var effect = el.data('animate-effect');
  19. if ( effect === 'fadeIn') {
  20. el.addClass('fadeIn animated-fast');
  21. } else if ( effect === 'fadeInLeft') {
  22. el.addClass('fadeInLeft animated-fast');
  23. } else if ( effect === 'fadeInRight') {
  24. el.addClass('fadeInRight animated-fast');
  25. } else {
  26. el.addClass('fadeInUp animated-fast');
  27. }
  28. el.removeClass('item-animate');
  29. }, k * 200, 'easeInOutExpo' );
  30. });
  31. }, 100);
  32. }
  33. } , { offset: '85%' } );
  34. };
  35. // On load
  36. $(function(){
  37. placeholderFunction();
  38. contentWayPoint();
  39. });
  40. }());