index.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. lexar
  3. Author - bootstrapdevelop
  4. Project Version - v1.0
  5. */
  6. (function ($) {
  7. "use strict";
  8. /**sticky*/
  9. $("#header").sticky({topSpacing:0});
  10. //auto close navbar-collapse on click a
  11. $('.nav-item>[data-scroll]').on('click', function () {
  12. $('.navbar-toggler:visible').click();
  13. });
  14. // Select all links with hashes
  15. /*
  16. lexar - Software HTML5 Landing Page
  17. Author - nilssatasiya
  18. Project Version - v1.0
  19. */
  20. (function ($) {
  21. "use strict";
  22. //auto close navbar-collapse on click a
  23. $('.nav-item').on('click', function () {
  24. $('.navbar-toggler:visible').click();
  25. });
  26. $('a[href*="#"]')
  27. // Remove links that don't actually link to anything
  28. .not('[href="#"]')
  29. .not('[href="#0"]')
  30. .click(function(event) {
  31. // On-page links
  32. if (
  33. location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') &&
  34. location.hostname == this.hostname
  35. ) {
  36. // Figure out element to scroll to
  37. var target = $(this.hash);
  38. target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
  39. // Does a scroll target exist?
  40. if (target.length) {
  41. // Only prevent default if animation is actually gonna happen
  42. event.preventDefault();
  43. $('html, body').animate({
  44. scrollTop: target.offset().top
  45. }, 1000, function() {
  46. // Callback after animation
  47. });
  48. }
  49. }
  50. });
  51. })(jQuery);
  52. $(document).ready(function(){
  53. $('[data-toggle="tooltip"]').tooltip();
  54. });
  55. $(".loader_pre").fadeTo(1,1).fadeOut(1);
  56. })(jQuery);