English 中文(简体)
互动式表格互动
原标题:table interactive
  • 时间:2012-05-24 05:57:02
  •  标签:
  • jquery
  • html

我希望有人能帮我解决一个小问题。我有一张桌子,有些细胞包含一个迪夫(div ) ( 设置隐藏 ) 。 鼠标在那个细胞的上面,我希望这个迪夫能够被看到。 下面是表格代码的摘录。

我需要的脚本应该检查单元格是否包含 div ; 在鼠标盘旋 div 时, 请显示并隐藏其它的脚本 。 如果光标没有在盘旋 div, 那么它不应该显示任何 div 。

<table>
    <tr>
        <th>Header One</th>
        <th>Header Two</th>
        <th>Header Three</th>
    </tr>
    <tr>
        <td>Something One
        <div id="wrapper1" class="hoverinfo" style="display:none;">
            <ul>
                <li>
                List Object One
                </li>
                <li>
                List Object Three
                </li>
                <li>
                List Object Four
                </li>
            </ul>
        </div></td>
        <td>Something Two</td>
        <td>Something three</td>
    </tr>
    <tr>
        <td>Something One</td>
        <td>Something Two
        <div id="wrapper2" class="hoverinfo" style="display:none;">
            <ul>
                <li>
                List Object five
                </li>
                <li>
                List Object six
                </li>
            </ul>
        </div></td>
        <td>Something three</td>
    </tr>
    <tr>
        <td>Something One
        <div id="wrapper2" class="hoverinfo" style="display:none;">
            <ul>
                <li>
                List Object seven
                </li>
                <li>
                List Object eight
                </li>
            </ul>
        </div></td>
        <td>Something Two</td>
        <td>Something three</td>
    </tr>
</table>
问题回答
$( td > div.hoverinfo ).mouseover(function() {
    $( td > div.hoverinfo ).hide();
    $(this).show();
}); 




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签