將註解定位在內部 (絕對)
重要性:5
延伸前一個任務 在元素附近顯示註解 (絕對):教授函式 positionAt(anchor, position, elem)
以將 elem
插入到 anchor
內部。
position
的新值
top-out
、right-out
、bottom-out
– 與之前相同,它們將elem
插入到anchor
的上方/右側/下方。top-in
、right-in
、bottom-in
– 將elem
插入到anchor
內部:將其貼到上/右/下邊緣。
例如
// shows the note above blockquote
positionAt(blockquote, "top-out", note);
// shows the note inside blockquote, at the top
positionAt(blockquote, "top-in", note);
結果
將任務 在元素附近顯示註解 (絕對) 的解答作為原始碼。