gpt4 book ai didi

javascript - ActionLink 图像悬停按钮效果与鼠标事件

转载 作者:太空宇宙 更新时间:2023-11-03 18:53:59 26 4
gpt4 key购买 nike

我想使用 jQuery 创建按钮效果,即 mouse_over、mouse_leave 和 mouse_click。我有使用 visual studio 2012 在 mvc 4 中的 ActionLink 中编写的链接。所以我想用稍大的图像更改图像,当鼠标离开时,它会返回原始图像并在单击链接时产生某种效果...

@Html.ActionLink(" ", "index1", "Home","index1", new {id="a1", @class="dashboard_function_icons"})

@Html.ActionLink(" ", "index2", "Home","index2", new {id="a2", @class = "dashboard_function_icons"})

@Html.ActionLink(" ", "index3", "Home","index3", new {id="a3", @class = "dashboard_function_icons"})

CSS CODE
---------
.dashboard_function_icons {

display:block;
height: 15px;
width: 20px;
padding-left: 80px;
padding-bottom: 80px;
margin-top:10px;
margin-left:10px;
float:left;
}

#a1 {
background: url("../Images/people.png") no-repeat;
}

#a2 {
background: url("../Images/ball.png") no-repeat;
}

#a3 {
background: url("../Images/save.png") no-repeat;
}

jQuery
-------
$(".dashboard_function_icons").hover(
function () { $(this).},
function () { $(this).;});

最佳答案

您可以使用 .addClass.removeClass悬停回调中的函数。

关于javascript - ActionLink 图像悬停按钮效果与鼠标事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14030493/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com