如何让jquery为datalist中的控件工作 [英] How to make jquery work for controls inside datalist
本文介绍了如何让jquery为datalist中的控件工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在一个数据表中我在表'Table3'中有一个图像,我在div id'HI'中有一些注释。
如果鼠标悬停在这个表上我想显示div id'HI 。当我运行以下代码时,我收到错误,指出在当前上下文中找不到表3。此Table3位于带图像的数据列表中。此图像是从sql表中检索的。
In a datalist I have an image inside a table 'Table3' and I have some comments in div id 'HI'.
If mouseover is on this table I want to show div id 'HI'. When I run the following code I get error stating that "Table3 is not found in the current context". This Table3 is inside a datalist with image. This image is retrieved from sql table.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">
</script>
<script>
$(document).ready(function() {
$("#HI").hide();
$('#<%=Table3.ClientID %>').mouseover(function() {
var div = $("#HI");
div.animate({ left: '357px', width:'74px',top:'330px', height:'33px' }, "fast");
div.animate({ fontSize: '2em' }, "fast");
$("#HI").show();
});
$('#<%=Table3.ClientID %>').mouseleave(function() {
var div = $("#HI");
$("#HI").hide();
});
});
</script>
推荐答案
(document).ready(function(){
(document).ready(function() {
(# HI)。hide();
("#HI").hide();
('#<% = Table3.ClientID %> ')。mouseover(function(){
var div =
('#<%=Table3.ClientID %>').mouseover(function() { var div =
这篇关于如何让jquery为datalist中的控件工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文