• ARعربي
  • ENEnglish
  • ESEspañol
  • FAفارسی
  • FRFrançais
  • IDIndonesia
  • ITItaliano
  • JA日本語
  • KO한국어
  • RUРусский
  • TRTürkçe
  • UKУкраїнська
  • ZH简体中文

ما قصد داریم این پروژهٔ متن‌باز را در دسترس همهٔ مردم در سرتاسر دنیا قرار دهیم.

به ترجمهٔ محتوای این آموزش به زبان خودتان کمک کنید/a>.

    نقشه آموزش
    اشتراک گذاری
    • آموزش
    • مرورگر: Document، Eventها، رابط‌ها
    • Document
    • Coordinates
    بازگشت به درس
    این محتوا تنها در این زبان‌ها موجود است: عربي, English, Español, Français, Italiano, 日本語, Русский, Türkçe, Українська, 简体中文. لطفاً به ما

    Show a note near the element

    اهمیت: 5

    Create a function positionAt(anchor, position, elem) that positions elem, depending on position near anchor element.

    The position must be a string with any one of 3 values:

    • "top" – position elem right above anchor
    • "right" – position elem immediately at the right of anchor
    • "bottom" – position elem right below anchor

    It’s used inside function showNote(anchor, position, html), provided in the task source code, that creates a “note” element with given html and shows it at the given position near the anchor.

    Here’s the demo of notes:

    باز کردن یک sandbox برای تمرین.

    In this task we only need to accurately calculate the coordinates. See the code for details.

    Please note: the elements must be in the document to read offsetHeight and other properties. A hidden (display:none) or out of the document element has no size.

    باز کردن راه‌حل درون sandbox.

    • © 2007—2025  Ilya Kantor
    • دربارهٔ پروژه
    • تماس با ما