为什么在jquery中使用Function()时获取多个图像
我对日历使用以下Jquery 我的消息来源如下为什么在jquery中使用Function()时获取多个图像,jquery,asp.net,Jquery,Asp.net,我对日历使用以下Jquery 我的消息来源如下 <script type="text/javascript"> $(function() { $('#ctl00_ContentPlaceHolder1_textbox1').datepick({showOnFocus: false, showTrigger: '#calImg'}); }); </script> <asp:TextBox ID="textbox1" runat="Server"> </a
<script type="text/javascript">
$(function()
{
$('#ctl00_ContentPlaceHolder1_textbox1').datepick({showOnFocus: false, showTrigger: '#calImg'});
});
</script>
<asp:TextBox ID="textbox1" runat="Server">
</asp:TextBox>
<img src="calendar.gif" alt="Popup" id="calImg" class="trigger" />
但当我在浏览器上看到为什么会发生这种情况时,我会看到多个图像
出于某种原因,datepick插件克隆了图像。可能的解决方法是在加载日期选择器后删除图像
<script type="text/javascript">
$(function()
{
$('#ctl00_ContentPlaceHolder1_textbox1').datepick({showOnFocus: false, showTrigger: '#calImg'});
$("#calImg").remove();
});
</script>
我不知道这个插件在内部是如何工作的,但您可以在示例->调用->来自图像中看到,它们只隐藏了原始图像:
<div style="display: none;">
<img id="calImg" src="img/calendar.gif" alt="Popup" class="trigger">
</div>
请澄清你的问题。获取多张图像是什么意思?什么是日期选择?顺便说一句,你的形象似乎被破坏了更新我的问题检查一次