Opentip读取表td元素标题属性并显示为内容

时间:2013-02-06 02:29:53

标签: jquery prototype opentip

<table id="universal-radio-program" title="Uzej ar pelīti uz nosaukumu, lai redzētu aprakstu...">
        <thead>
        <tr><th>&nbsp;</th><th scope="col">Pirmdiena</th><th scope="col">Otrdiena</th><th scope="col">Tre&scaron;diena</th><th scope="col">Ceturtdiena</th><th scope="col">Piektdiena</th><th scope="col">Sestdiena</th><th scope="col">Svētdiena</th><th>&nbsp;</th></tr>
        </thead>
        <tbody>
        <tr>
        <td>00</td>
        <td title="Dance / Hands Up, Trance, New Tunes..." rowspan="2" colspan="4">Prepare for Morning</td>
        <td title="Presents by Universal Radio X selection...">Take The Chance Of Dance with Universal Radio</td>
        <td title="Universal Radio DJ Team Lives...">URDT Live Sets</td>
        <td title="Universal Radio DJ Team Lives...">&nbsp;</td>
        <td><strong>00</strong></td>
        </tr>
        <tr>
        <td>01</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>01</td>
        </tr>
        <tr>
        <td>02</td>
        <td title="Progressive, Trance, Techtrance, Hard Trance tunes...">Trance Edition!</td>
        <td title="Progressive, Trance, Techtrance, Hard Trance tunes...">&nbsp;</td>
        <td title="Progressive, Trance, Techtrance, Hard Trance tunes...">&nbsp;</td>
        <td title="Progressive, Trance, Techtrance, Hard Trance tunes...">&nbsp;</td>
        <td title="Progressive, Trance, Techtrance, Hard Trance tunes...">&nbsp;</td>
        <td title="Progressive, Trance, Techtrance, Hard Trance tunes...">&nbsp;</td>
        <td title="Progressive, Trance, Techtrance, Hard Trance tunes...">&nbsp;</td>
        <td>02</td>
        </tr>
        </tbody>
        <tfoot>
        <tr><th scope="row">&nbsp;</th>
        <td>Pirmdiena</td>
        <td>Otrdiena</td>
        <td>Tre&scaron;diena</td>
        <td>Ceturtdiena</td>
        <td>Piektdiena</td>
        <td>Sestdiena</td>
        <td>Svētdiena</td>
        <th>&nbsp;</th></tr>
        </tfoot>
        </table>

以下是一些例子:

http://jsfiddle.net/Hwb2S/1/

我想要Opentip读取表td元素标题属性并显示为分组opentip内容。并删除默认的标题属性。

我更喜欢的适配器是原型,但也可以是 jquery

所有关于 opentip http://www.opentip.org

请使用您的解决方案更新 jsfiddle

1 个答案:

答案 0 :(得分:0)

我很困惑为什么你不能将这些转换为Opentip识别的标题标签。实际上,你完成了90%的工作。只需做一个小小的调整,你就在那里

<td data-ot="Progressive, Trance, Techtrance, Hard Trance tunes...">Trance Edition!</td>