User talk:The Transhumanist/ViewAnnotationToggler.js: Difference between revisions

Content deleted Content added
Complication: add link
Complication: revise msg, refresh ping
Line 662:
=== Complication ===
 
[[User:{{ping|Evad37|Evad]],}} I inserted the above code that you provided (above) into [[User:The Transhumanist/anno.js|the script]], and itthe script repositioned the viewport in a surprising way.
 
It realigned to the script's menu item on the sidebar. I hadn't noticed before that it has been doing this all along. Apparently it does this because of following code near the end of the function:
Line 680:
Maybe this problem could be fixed with the [https://www.w3schools.com/jsref/met_win_scrollto.asp Window scrollTo() Method], if there was some way to record the scroll position of the window in the first place. If there was, the measurement could be taken before the menu item was updated, and then the position restored via window.scrollTo(''xpos'', ''ypos'') after the change was completed.
 
I tried sandwiching the menu item updating operations with <code>y&nbsp;=&nbsp;window.scrollY;
I was wondering, since you came up with the innovative solution above, if you might be able to think of a way to fix this complication?
</code> and <code>window.scrollTo(0,&nbsp;y);</code>, but it is not working for some reason. I placed <code>var&nbsp;y;</code> at the beginning of the script.
 
I was very impressed with the solution you dreamed up above, and was wondering if you might have any ideas on how to fix this complication.
I look forward to your reply, [[User talk:The Transhumanist|<i>The&nbsp;Transhumanist</i>]] 03:46, 8 July 2017 (UTC)
 
I look forward to your reply, [[User talk:The Transhumanist|<i>The&nbsp;Transhumanist</i>]] 0316:4601, 8 July 2017 (UTC)
 
== Find/verify non-li list-lead entries ==