OSDN Git Service

Correctly handle internal page section references.
[mingw/website.git] / site.js
diff --git a/site.js b/site.js
index 1a7c368..b684e92 100644 (file)
--- a/site.js
+++ b/site.js
@@ -73,6 +73,11 @@ function load_content( container, src )
          update_page_content_header( "title" );
          update_page_content_header( "subtitle" );
          set_content( "e404-missing-page", document.URL );
+         if( src.includes("#") )
+         { src = src.substring( src.indexOf("#") + 1, src.length );
+           element = document.getElementById( src );
+           if( element ) element.scrollIntoView();
+         }
          break;
        case 404:
          load_content( container, "missing.html" );