freelancer.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*!
  2. * Start Bootstrap - Freelancer Bootstrap Theme (http://startbootstrap.com)
  3. * Code licensed under the Apache License v2.0.
  4. * For details, see http://www.apache.org/licenses/LICENSE-2.0.
  5. */
  6. // jQuery for page scrolling feature - requires jQuery Easing plugin
  7. $(function() {
  8. $('body').on('click', '.page-scroll a', function(event) {
  9. var $anchor = $(this);
  10. $('html, body').stop().animate({
  11. scrollTop: $($anchor.attr('href')).offset().top
  12. }, 1500, 'easeInOutExpo');
  13. event.preventDefault();
  14. });
  15. });
  16. // Floating label headings for the contact form
  17. $(function() {
  18. $("body").on("input propertychange", ".floating-label-form-group", function(e) {
  19. $(this).toggleClass("floating-label-form-group-with-value", !! $(e.target).val());
  20. }).on("focus", ".floating-label-form-group", function() {
  21. $(this).addClass("floating-label-form-group-with-focus");
  22. }).on("blur", ".floating-label-form-group", function() {
  23. $(this).removeClass("floating-label-form-group-with-focus");
  24. });
  25. });
  26. // Highlight the top nav as scrolling occurs
  27. $('body').scrollspy({
  28. target: '.navbar-fixed-top'
  29. });
  30. // Closes the Responsive Menu on Menu Item Click
  31. $('.navbar-collapse ul li a').click(function() {
  32. $('.navbar-toggle:visible').click();
  33. });