问题描述
在我的项目中,我有母版页和声音页。在我的母版页面中,我有5个按钮。我想在鼠标悬停在这些按钮上时显示一些文字。我尝试使用一个ID为Button6的按钮。下面的代码应显示'Amla',当鼠标悬停在按钮ID为Button6的按钮上时。它没有显示'Amla'。我已将div id:'amla'放在body标签中。
In my project I have master page and sontent pages. In my master page I have 5 buttons. I want to show some text while the mouse hovers on those buttons. I tried with one button that has ID as 'Button6'. Here is the following code that should show 'Amla' when that mouse hovers on that button with button ID as 'Button6'. It is not showing 'Amla'. I have placed the div id:'amla' in body tag.
<head runat="server">
<link rel="shortcut icon" type="image/x-icon" href="~/favicon (10).ico" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">
</script>
<script>
$(document).ready(function() {
$("#Amla").hide();
$('#<%=Button6.ClientID %>').mouseover(function(){
var div = $("#Amla");
div.animate({ left: '3px', width:'74px',top:'3px', height:'33px' }, "fast");
div.animate({ fontSize: '2em' }, "fast");
$("#Amla").show();
});
$('#<%=Button6.ClientID %>').mouseleave(function() {
var div = $("#Amla");
// div.animate({ left: '401px' }, "slow");
// div.animate({ fontSize: '1em' }, "slow");
$("#Amla").hide();
});
</script>
< div id =Amlarunat =serverstyle =background :white; position:absolute;> Amla
<div id="Amla" runat="server" style="background:white; position:absolute;">Amla
推荐答案
这篇关于鼠标悬停,mouseout功能无法在母版页中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!