添加第二个onmouseover操作

时间:2018-05-10 08:00:55

标签: javascript php jquery

我有以下脚本:

<?php
$main_image  = get_field('main_image');
$hover_image  = get_field('hover_image');
$button_text  = get_field('button_text');
?>


<img src="<?php echo $main_image; ?>"
onmouseover="this.src='<?php echo $hover_image; ?>'" 
onmouseout="this.src='<?php echo $main_image; ?>'" />

如何在鼠标悬停时显示<?php echo $button_text; ?>

谢谢!

2 个答案:

答案 0 :(得分:2)

每当鼠标悬停事件运行时,您都可以使用img标签的title属性来显示$ button_text值。 例如

<img src="<?php echo $main_image; ?>" title=""
onmouseover="this.src='<?php echo $hover_image; ?>'" 
onmouseout="this.src='<?php echo $main_image; ?>'" />

如果您想以不同的方式显示按钮文字,那么还让我知道您想要如何显示?所以我也可以帮助你。

答案 1 :(得分:0)

Sub deleteDuplicate()

    Dim ws As Worksheet
    Dim wkbk1 As Workbook
    Dim w As Long
    Dim lRow As Long
    Dim iCntr As Long

    Set wkbk1 = Workbooks("3rd Party.xlsm")

    wkbk1.Activate

    For Each ws In ThisWorkbook.Worksheets

        ' Find last row in column A
        lRow = ws.Range("A" & ws.Rows.count).End(xlUp).Row

        For iCntr = lRow To 1 Step -1

            ws.lRow.RemoveDuplicates Columns:=1, Header:=xlYes

        Next iCntr

    Next ws

End Sub

我提供了一个与您的要求相关的示例,请查看此示例,如果您有任何疑虑,请告诉我。