OSDN Git Service

Rename project domain to reflect relocation to MinGW.OSDN.io
[mingw/website.git] / site.js
diff --git a/site.js b/site.js
index 1a7c368..4a5f9ad 100644 (file)
--- a/site.js
+++ b/site.js
@@ -7,7 +7,7 @@
  * $Id$
  *
  * Written by Keith Marshall <keith@users.osdn.me>
- * Copyright (C) 2020, MinGW.org Project
+ * Copyright (C) 2020, 2021, MinGW.OSDN Project
  *
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -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" );