Показать подсказку в документе готов

Я использую плагин Drew Wilsons Tip Tip с модифицированными методами для "показа", "скрытия" или "уничтожения" подсказки...

По какой-то причине я не могу получить все всплывающие подсказки в документе, но они не появятся. Интересно, кто-то может привести меня в правильном направлении... вот мой код....

JQuery:

jQuery(document).ready(function($) {
$(".botpage a").tipTip({ content: "This is an anchor tag!"});
$(".botpage a").tipTip('show');
});

TipTip по умолчанию

var defaults = {
        activation: "hover", // How to show (and hide) the tooltip. Can be: hover, focus, click and manual.
        keepAlive: false, // When true the tooltip won't disapper when the mouse moves away from the element. Instead it will be hidden when it leaves the tooltip.
        maxWidth: "200px", // The max-width to set on the tooltip. You may also use the option cssClass to set this.
        edgeOffset: 6, // The offset between the tooltip arrow edge and the element that has the tooltip.
        defaultPosition: "bottom", // The position of the tooltip. Can be: top, right, bottom and left.
        delay: 400, // The delay in msec to show a tooltip.
        fadeIn: 200, // The length in msec of the fade in.
        fadeOut: 200, // The length in msec of the fade out.
        attribute: "title", // The attribute to fetch the tooltip text if the option content is false.
        content: false, // HTML or String or Function (that returns HTML or String) to fill TipTIp with
        enter: function () { }, // Callback function before a tooltip is shown.
        afterEnter: function () { }, // Callback function after a tooltip is shown.
        exit: function () { }, // Callback function before a tooltip is hidden.
        afterExit: function () { }, // Callback function after a tooltip is hidden.
        cssClass: '' // CSS class that will be applied on the tooltip before showing only for this instance of tooltip.
    };

HTML

<div class="botpage">
<a>TOOLTIP YAY!</a>
</div>

Что я делаю неправильно??? если вам нужен какой-либо другой код, дайте мне знать!

1 ответ

Ах, ха. Я вижу проблему. Это показывает всплывающую подсказку. Но это только показывает ОДИН. Похоже, что плагин может позволить вам показывать только по одному за раз. Смотрите эту обновленную скрипку: jsfiddle.net/ygswQ/1. Таким образом, вам может понадобиться изменить исходный код или использовать другой плагин подсказки, который позволяет вам это сделать.

Существует множество плагинов для подсказок jQuery. Один из самых популярных, на мой взгляд, это qtip. Вот пример того, как вы можете сделать это в qTip: http://jsfiddle.net/GEycz/

Другие вопросы по тегам