Bootstrap 5: Tooltip


فهرست مطالب

    نمایش فهرست مطالب

ﺭﺍﺰﺑﺍ ﺕﺎﮑﻧ

:ﺩﻮﺷ ﯽﻣ ﺮﻫﺎﻇ ﺩﺮﺑ ﯽﻣ ﺮﺼﻨﻋ ﮏﯾ ﯼﻭﺭ ﺍﺭ ﺱﻭﺎﻣ ﺮﮕﻧﺎﺸﻧ ﺮﺑﺭﺎﮐ ﯽﺘﻗﻭ ﻪﮐ ﺖﺳﺍ ﮏﭼﻮﮐ ﭖﺁ ﭖﺎﭘ ﺭ

ﺭﺍﺰﺑﺍ ﯼﺎﻤﻨﻫﺍﺭ ﮏﯾ ﺩﺎﺠﯾﺍ ﻩﻮﺤﻧ

.ﺪﯿﻨﮐ ﻪﻓﺎﺿﺍ ﺮﺼﻨﻋ ﮏﯾ ﻪﺑ ﺍﺭ data-bs-toggle="tooltip"

:ﺪﯿﻨﮐ ﻩﺩﺎﻔﺘﺳﺍ ﺩﻮﺷ ﻩﺩﺍﺩ ﺶﯾﺎﻤﻧ ﺭﺍﺰﺑﺍ ﯼﺎﻤﻨﻫﺍﺭ ﺭﺩ ﺪﯾﺎﺑ ﻪﮐ ﯽﻨﺘﻣ ﻦﯿﯿﻌﺗ ﯼﺍﺮﺑ

button type="button" class="btn btn-primary" data-bs-toggle="tooltip" title="Hooray!">Hover over me!</button>

ﻪﺟﻮﺗ: ﺪﻧﻮﺷ ﻪﯿﻟﻭﺍ ﯽﻫﺩﺭﺍﺪﻘﻣ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺎﺑ ﺪﯾﺎﺑ ﺭﺍﺰﺑﺍ ﺕﺎﮑﻧ ،ﻥﺩ

:ﺪﻨﮐ ﯽﻣ ﻝﺎﻌﻓ ﺪﻨﺳ ﺭﺩ ﺍﺭ ﺭﺍﺰﺑﺍ ﯼﺎﻤﻨﻫﺍﺭ ﻡﺎﻤﺗ ﺮﯾﺯ ﺪﮐ

ﻝﺎﺜﻣ

<script>
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
  return new bootstrap.Tooltip(tooltipTriggerEl)
})
</script>

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>

<div class="container mt-3">
  <h3>Tooltip Example</h3>
  
  <button type="button" class="btn btn-primary" data-bs-toggle="tooltip" title="Hooray!">
    Hover over me!
  </button>
</div>

<script>
// Initialize tooltips
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
  return new bootstrap.Tooltip(tooltipTriggerEl)
})
</script>

</body>
</html>

ﯽﺑﺎﯾ ﺖﯿﻌﻗﻮﻣ ﺭﺍﺰﺑﺍ ﺕﺎﮑﻧ

.ﺩﻮﺷ ﯽﻣ ﺮﻫﺎﻇ ﺮﺼﻨﻋ ﯼﻻﺎﺑ ﺭﺩ ﺭﺍﺰﺑﺍ ﯼﺎﻤﻨﻫﺍﺭ ،ﺽﺮﻓ ﺶﯿﭘ ﺭﻮﻃ ﻪﺑ

:ﺪﯿﻨﮐ ﻩﺩﺎﻔﺘﺳﺍ ﺮﺼﻨﻋ ﺖﺳﺍﺭ ﺖﻤﺳ ﺎﯾ ﭗﭼ ﺖﻤﺳ ،ﻦﯿﯾﺎﭘ ،ﻻﺎﺑ ﺭﺩ ﺭﺍﺰﺑﺍ ﯼﺎﻤﻨﻫﺍﺭ ﺖﯿﻌﻗﻮﻣ ﻢﯿﻈﻨ

ﻝﺎﺜﻣ

<a href="#" data-bs-toggle="tooltip" data-bs-placement="top" title="Hooray!">Hover</a>
<a href="#" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Hooray!">Hover</a>
<a href="#" data-bs-toggle="tooltip" data-bs-placement="left" title="Hooray!">Hover</a>
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" title="Hooray!">Hover</a>

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>

<div class="container mt-3">
  <h3>Tooltip Positioning</h3>
  <p>The data-bs-placement attribute specifies the tooltip position.</p>
  <a href="#" data-bs-toggle="tooltip" data-bs-placement="top" title="Hooray!">Top</a>
  <a href="#" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Hooray!">Bottom</a>
  <a href="#" data-bs-toggle="tooltip" data-bs-placement="left" title="Hooray!">Left</a>
  <a href="#" data-bs-toggle="tooltip" data-bs-placement="right" title="Hooray!">Right</a>
</div>

<script>
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
  return new bootstrap.Tooltip(tooltipTriggerEl)
})
</script>

</body>
</html>

تمامی حقوق محفوظ است. © BasicIT.org • 2023-2024