【问题标题】:How can we make the div follow the cursor in angular when mouse over and disappear when mouse is out?我们如何使 div 在鼠标悬停时以角度跟随光标并在鼠标离开时消失?
【发布时间】:2022-01-17 03:13:30
【问题描述】:

我有一个表格,下面有几行信息

## html ##
<div>
    <table>
        <thead>
            <tr>
                <th>Name</th>
                <th>email</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td (mouseover)="onMouseDisplay(true)" (mouseleve)="onMouseDisplay(false)">Daya</td>
                <td>d@xxx.mail.com</td>
            </tr>
            <tr>
                <td (mouseover)="onMouseDisplay(true)" (mouseleve)="onMouseDisplay(false)">Vinci</td>
                <td>v@xxx.mail.com</td>
            </tr>
            <tr>
                <td (mouseover)="onMouseDisplay(true)" (mouseleve)="onMouseDisplay(false)">Teju</td>
                <td>t@xxx.mail.com</td>
            </tr>
        </tbody>
    </table>
</div>

当鼠标悬停时有条件地显示并在鼠标离开时消失 我有另一个 div,它必须更靠近 tr“rows”,这应该只在鼠标悬停时显示,并且应该在 mouseleve 上

<div id="moving" *ngIf="isShow">
    <div class="tooltip">
        <p>i'm not moving as per the position of the row items</p>
    </div>
</div>

有条件地显示/隐藏的功能


isShow: boolean;

onMouseDisplay(show: boolean) {
    this.isShow = show;
}

【问题讨论】:

    标签: javascript html css angular


    【解决方案1】:

    不明白你想要什么,但你在(mouseleave)中有一个拼写错误

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多