मोबाइल टूलटिप्स कार्यान्वयन
जब आप टाइटल एट्रिब्यूट वाले एलिमेंट पर क्लिक करेंगे, तो टाइटल टेक्स्ट के साथ एक चाइल्ड एलिमेंट जोड़ा जाता है।
HTML के लिए
<p>
The <span class="demo" title="this is underscore">underlined</span> character.
</p>
jQuery
$("span[title]").click(function () {
var $title = $(this).find(".title");
if (!$title.length) {
$(this).append('' + $(this).attr("title") + '');
} else {
$title.remove();
}
});
CSS
.demo {
border-bottom: 2px dotted;
position: relative;
}
.demo .title {
position: absolute;
top: 15px;
background: gray;
padding: 5px;
left: 0;
white-space: nowrap;
}
यह मोबाइल डिवाइसेज पर क्लिक-टू-शो टूलटिप्स बनाता है जहां होवर उपलब्ध नहीं है।