in English

अलर्ट

उपलब्ध आ लचीला अलर्ट संदेशक कें मुट्ठी भर कें साथ विशिष्ट उपयोगकर्ता क्रियाक कें लेल संदर्भ प्रतिक्रिया संदेश प्रदान करूं.

उदाहरण के लिये

कोनों भी लंबाई कें पाठ कें लेल अलर्ट उपलब्ध छै, साथ ही वैकल्पिक खारिज बटन भी उपलब्ध छै. उचित स्टाइलिंग कें लेल, आठ आवश्यक संदर्भ वर्गक मे सं एकटा कें उपयोग करूं (जैना, .alert-success). इनलाइन बर्खास्तगी क लेल, अलर्ट क उपयोग करू jQuery प्लगइन .

<div class="alert alert-primary" role="alert">
  A simple primary alert—check it out!
</div>
<div class="alert alert-secondary" role="alert">
  A simple secondary alert—check it out!
</div>
<div class="alert alert-success" role="alert">
  A simple success alert—check it out!
</div>
<div class="alert alert-danger" role="alert">
  A simple danger alert—check it out!
</div>
<div class="alert alert-warning" role="alert">
  A simple warning alert—check it out!
</div>
<div class="alert alert-info" role="alert">
  A simple info alert—check it out!
</div>
<div class="alert alert-light" role="alert">
  A simple light alert—check it out!
</div>
<div class="alert alert-dark" role="alert">
  A simple dark alert—check it out!
</div>
सहायक प्रौद्योगिकी के अर्थ संप्रेषित करब

अर्थ जोड़य कें लेल रंग कें उपयोग करनाय केवल एकटा दृश्य संकेत प्रदान करय छै, जे सहायक प्रौद्योगिकी कें उपयोगकर्ताक कें – जेना स्क्रीन रीडर – कें संप्रेषित नहि कैल जेतय. सुनिश्चित करूं कि रंग सं संकेत कैल गेल जानकारी या त सामग्री सं ही स्पष्ट छै (जैना दृश्यमान पाठ), या वैकल्पिक साधन कें माध्यम सं शामिल कैल गेल छै, जेना कि .sr-onlyवर्ग कें साथ छिपल अतिरिक्त पाठ.

.alert-linkकोनों अलर्ट कें भीतर जल्दी सं मिलान करय वाला रंगीन लिंक उपलब्ध करावा कें लेल उपयोगिता वर्ग कें उपयोग करूं .

<div class="alert alert-primary" role="alert">
  A simple primary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-secondary" role="alert">
  A simple secondary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-success" role="alert">
  A simple success alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-danger" role="alert">
  A simple danger alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-warning" role="alert">
  A simple warning alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-info" role="alert">
  A simple info alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-light" role="alert">
  A simple light alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-dark" role="alert">
  A simple dark alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>

अतिरिक्त सामग्री

अलर्ट मे अतिरिक्त एचटीएमएल तत्व जेना हेडिंग, पैराग्राफ आ डिवाइडर सेहो भ सकैत अछि ।

<div class="alert alert-success" role="alert">
  <h4 class="alert-heading">Well done!</h4>
  <p>Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.</p>
  <hr>
  <p class="mb-0">Whenever you need to, be sure to use margin utilities to keep things nice and tidy.</p>
</div>

बर्खास्त करब

अलर्ट जावास्क्रिप्ट प्लगइन कें उपयोग करयत, कोनों अलर्ट कें इनलाइन खारिज करनाय संभव छै. एतय कोना देल गेल अछि :

  • सुनिश्चित करू जे अहाँ अलर्ट प्लगइन, अथवा संकलित बूटस्ट्रैप जावास्क्रिप्ट लोड कएने छी.
  • यदि अहाँ हमर जावास्क्रिप्ट स्रोत सँ बना रहल छी, त' एकरा आवश्यकताutil.js अछि . संकलित संस्करण मे ई शामिल अछि।
  • एकटा डिस्मिस बटन आ .alert-dismissibleक्लास जोड़ू, जे अलर्ट के दाहिना तरफ अतिरिक्त पैडिंग जोड़ैत अछि आ .closeबटन के पोजीशन दैत अछि.
  • खारिज बटन पर, data-dismiss="alert"विशेषता जोड़ू, जे जावास्क्रिप्ट कार्यक्षमता कें ट्रिगर करयत छै. <button>सब डिवाइस मे उचित व्यवहार क लेल तत्व क उपयोग जरूर करू .
  • ओकरा खारिज करय कें समय अलर्ट कें एनिमेट करय कें लेल, .fade.showवर्गक कें जरूर जोड़ूं.

एकरा अहां लाइव डेमो सं एक्शन मे देख सकय छी:

<div class="alert alert-warning alert-dismissible fade show" role="alert">
  <strong>Holy guacamole!</strong> You should check in on some of those fields below.
  <button type="button" class="close" data-dismiss="alert" aria-label="Close">
    <span aria-hidden="true">&times;</span>
  </button>
</div>

जावास्क्रिप्ट व्यवहार

ट्रिगर करैत अछि

जावास्क्रिप्ट के माध्यम स एकटा अलर्ट के खारिज करब सक्षम करू:

$('.alert').alert()

अथवा अलर्ट के भीतरdata एक बटन पर विशेषता के साथ , जैसा कि ऊपर प्रदर्शित किया गया है:

<button type="button" class="close" data-dismiss="alert" aria-label="Close">
  <span aria-hidden="true">&times;</span>
</button>

ध्यान राखू जे कोनो अलर्ट बंद करला सं ओकरा डीओएम सं हटा देल जाएत.

विधियाँ

तरीका वर्णन
$().alert() वंशज तत्वक पर क्लिक घटनाक कें लेल एकटा अलर्ट सुनय कें लेल बनायत छै जइ मे data-dismiss="alert"विशेषता छै. (डेटा-एपीआई कें ऑटो-इनिशियलाइजेशन कें उपयोग करय कें समय आवश्यक नहि.)
$().alert('close') कोनों अलर्ट कें डीओएम सं हटा क बंद करएयत छै. यदि तत्व पर .fadeआरू .showवर्ग मौजूद छै, त॑ अलर्ट हटाबै स॑ पहल॑ फीका होय जैतै ।
$().alert('dispose') कोनो तत्व के अलर्ट के नष्ट करैत अछि.
$('.alert').alert('close')

घटनाक्रम

बूटस्ट्रैप कें अलर्ट प्लगइन अलर्ट कार्यक्षमता मे हुक करय कें लेल किच्छू घटनाक कें उजागर करयत छै.

घटना वर्णन
close.bs.alert closeइंस्टेंस मेथड कें कॉल करय पर इ घटना तुरंत फायर भ जायत छै.
closed.bs.alert ई घटना तखन फायर कएल जाइत अछि जखन अलर्ट बंद भ' गेल अछि (सीएसएस संक्रमण पूरा होएबाक प्रतीक्षा करत).
$('#myAlert').on('closed.bs.alert', function () {
  // do something...
})