Changes

fix syntax highlighting error
Line 536: Line 536:     
When a page has collapsible elements, section links often break because the page jumps away after JavaScript loads ([[Abigail#Eight Hearts|see example]]). [https://techcrunch.com/2017/04/11/chrome-now-uses-scroll-anchoring-to-prevent-those-annoying-page-jumps/ Chrome has a feature to fix that], but other browsers like Firefox don't. I suggest adding this snippet to [[MediaWiki:Common.js]], which just moves the page back to the linked section after JavaScript is loaded:
 
When a page has collapsible elements, section links often break because the page jumps away after JavaScript loads ([[Abigail#Eight Hearts|see example]]). [https://techcrunch.com/2017/04/11/chrome-now-uses-scroll-anchoring-to-prevent-those-annoying-page-jumps/ Chrome has a feature to fix that], but other browsers like Firefox don't. I suggest adding this snippet to [[MediaWiki:Common.js]], which just moves the page back to the linked section after JavaScript is loaded:
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
$(function() {
 
$(function() {
 
   if (location.hash) {
 
   if (location.hash) {
Line 544: Line 544:  
   }
 
   }
 
});
 
});
</source>
+
</syntaxhighlight>
 
(You can try the snippet by adding it to [[Special:MyPage/common.js|your <tt>common.js</tt> subpage]].) —<small>[[User:Pathoschild|Pathoschild]] ([[User talk:Pathoschild|talk]]) 17:02, 25 December 2018 (UTC)</small>
 
(You can try the snippet by adding it to [[Special:MyPage/common.js|your <tt>common.js</tt> subpage]].) —<small>[[User:Pathoschild|Pathoschild]] ([[User talk:Pathoschild|talk]]) 17:02, 25 December 2018 (UTC)</small>
 
:+1 for adding this (to all languages)  [[User:Margotbean|margotbean]] ([[User talk:Margotbean|talk]]) 21:06, 31 December 2018 (UTC)
 
:+1 for adding this (to all languages)  [[User:Margotbean|margotbean]] ([[User talk:Margotbean|talk]]) 21:06, 31 December 2018 (UTC)
106,306

edits