So take a look at www.qualificationcheck.com in both Chrome and Firefox. Alt-Tab quickly moves between them, focusing on the small green tab "help and feedback".
Seems to be a moving position! What is it?
Included in it is a third-party Javascript file. I looked at him to find out how he calculates his position.
First, he sets top: 50% to get about 50% of the way down the viewing screen.
Then he sets
margin-top: [ "-",Math.round(tab.dimensions.height / 2), "px" ].join("")
those. minus half the height of the tab, so it moves slightly upward, so the βmiddleβ of it actually makes up 50% of the way down the viewport (not the βtopβ).
Using the Chrome dev tools and then firebug in Firefox, I see that in Chrome margin-top ends with -33px, and in Firefox it ends up in -87px.
Why is the difference?
It annoys him because I want to add my own tab above or below it, but I cannot determine where to place my own tab, if I cannot rely on a third-party one to be in the same position all the time
javascript css
Nick foote
source share