app_landing.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. "use strict";
  2. var app_landing = {
  3. header:
  4. {
  5. height: function(){
  6. if($("#header > .header-content").outerHeight(true) < $(window).outerHeight(true)){
  7. $("#header").height($(window).outerHeight(true));
  8. }else{
  9. $("#header").height("auto");
  10. }
  11. },
  12. scroll: function(){
  13. $(window).scroll(function(){
  14. if($(window).width() > 992){
  15. if($(window).scrollTop() > 100) {
  16. $("#header .header").addClass("fixed animated fadeInDown");
  17. } else {
  18. $("#header .header").removeClass("fixed fadeInDown");
  19. }
  20. }else{
  21. $("#header .header").removeClass("fixed fadeInDown");
  22. }
  23. });
  24. },
  25. navigation: function(){
  26. var self = this;
  27. $(".navigation-toggle").on("click",function(){
  28. $("#header .header .navigation").toggleClass("show");
  29. self.height();
  30. });
  31. $(".navigation a").on("click",function(){
  32. var href = $(this).attr("href");
  33. $("html, body").animate({
  34. scrollTop: $(href).offset().top
  35. }, 500);
  36. });
  37. }
  38. }
  39. };
  40. $(function(){
  41. app_landing.header.height();
  42. app_landing.header.scroll();
  43. app_landing.header.navigation();
  44. });
  45. $(window).resize(function(){
  46. app_landing.header.height();
  47. });
  48. var delayBeforeFire = (function(){
  49. var timer = 0;
  50. return function (callback, ms) {
  51. clearTimeout(timer);
  52. timer = setTimeout(callback, ms);
  53. };
  54. })();