मैं वर्तमान में अपने पॉपओवर में सामग्री को गतिशील रूप से जोड़ने के लिए एक स्क्रिप्ट कहता हूं लेकिन जब उपयोगकर्ता इसे बंद करने के लिए फिर से क्लिक करता है तो मुझे यह कॉल करने की आवश्यकता नहीं होती है। क्या यह राज्य को प्राप्त करना और इसे दिखने पर बंद करना संभव है?क्या मुझे ट्विटर बूटस्ट्रैप पॉपओवर की वर्तमान स्थिति मिल सकती है?
$('.knownissue').on('click', function() {
var info = $(this).attr('id').substr(5).split(':');
var el = $(this);
// How do I check to see if the popover is visible
// so I can simply close it and exit?
$.post('functions/get_known_issues.php?tcid='+info[0]+'&tcdate=' + info[1], function(data) {
if (data.st) {
el.attr('data-content', data.issue);
el.popover('toggle');
}
}, "json");
});
यदि आप देखते हैं कि प्लगइन कैसे जांचता है (github)] (https://github.com/twitter/bootstrap/blob/v2.2.1/js/bootstrap-tooltip.js#L240) – Sherbrow