鼠标悬停在linkbutton图像上应显示在jquery中 [英] mouse over on linkbutton image should be display in jquery
本文介绍了鼠标悬停在linkbutton图像上应显示在jquery中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下午好每一个。
我有5个链接按钮。当鼠标悬停在链接按钮上时,应该显示特定的图像。这是我的代码。任何人都请告诉我。
谢谢。
Hi Good Afternoon Every One.
I have 5 linkbuttons.when mouseover on linkbutton particular image should be display.here is my code.can anyone tell me please.
thank you.
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="jquery/jquery-1.10.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#link1').mouseover(function () {
$('#img1').replaceWith("<img src='images/1.JPG' width=200 height=200/>");
});
$('#link2').mouseover(function () {
alert('hi');
$('#img1').replaceWith("<img src='images/2.JPG' width=200 height=200/>");
});
$('#link3').mouseover(function () {
$('#img1').replaceWith("<img src='images/3.JPG' width=200 height=200/>");
});
$('#link4').mouseover(function () {
$('#img1').replaceWith("<img src='images/4.JPG' width=200 height=200/>");
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<img id="img1" />
<asp:LinkButton ID="link1" runat="server" Text="Pradeep"></asp:LinkButton><br />
<asp:LinkButton ID="link2" runat="server" Text="deepu"></asp:LinkButton><br />
<asp:LinkButton ID="link3" runat="server" Text="pandu"></asp:LinkButton><br />
<asp:LinkButton ID="link4" runat="server" Text="bittoo"></asp:LinkButton><br />
</div>
</form>
</body>
</html>
推荐答案
(document).ready(function(){
(document).ready(function () {
( '#link1')。mouseover(function(){
('#link1').mouseover(function () {
('#img1')。replaceWith(< < span class =code-leadattribute> img src =' images / 1.JPG' width = 200 身高 = 200 / > < /跨度>);
});
('#img1').replaceWith("<img src='images/1.JPG' width=200 height=200/>"); });
这篇关于鼠标悬停在linkbutton图像上应显示在jquery中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文