docs.js 930 B

1234567891011121314151617181920212223242526272829
  1. $(function () {
  2. bindEvents();
  3. });
  4. function bindEvents() {
  5. var win = $(window), body = $(document.body);
  6. body.scrollspy({target: ".icl-docs-sidebar"});
  7. win.on("load", function () {
  8. body.scrollspy("refresh")
  9. });
  10. $('.icl-docs-container [href="#"]').click(function (evt) {
  11. evt.preventDefault()
  12. });
  13. setTimeout(function () {
  14. var sidebar = $(".icl-docs-sidebar");
  15. sidebar.affix({
  16. offset: {
  17. top: function () {
  18. var top = sidebar.offset().top;
  19. // marginTop = parseInt(sidebar.children(0).css("margin-top"), 10),
  20. // height = $(".main-header").height();
  21. return this.top = top;
  22. },
  23. bottom: function () {
  24. return this.bottom = $(".icl-docs-footer").outerHeight(!0)
  25. }
  26. }
  27. })
  28. }, 100);
  29. }