Jquery不工作 [英] Jquery are not working
本文介绍了Jquery不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<script language="javascript" type="text/javascript">
$("#ctl00_ContentPlaceHolder1_DataList1_ctl00_gallery").click(function() {
$("#ctl00_ContentPlaceHolder1_DataList1_ctl00_FileUpload1").click();
});
</script>
<asp:DataList ID="DataList1" runat="server" RepeatDirection="Horizontal" RepeatColumns="4" width="100%">
<ItemTemplate>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="center"><asp:ImageButton ID="gallery"
ImageUrl='<%# Eval("photo_name") %>' runat="server" width="180" height="200"
CssClass="img-responsive img-thumbnail" onclick="gallery_Click" />
<asp:Label ID="imageid" runat="server" Text='<%#Eval("proimg_id") %>' Visible="false" ></asp:Label>
<asp:Label ID="userid" runat="server" Text='<%#Eval("user_id") %>' Visible="false" ></asp:Label>
</td>
<div style="display:none;" >
<asp:FileUpload ID="FileUpload1" runat="server" />
</div>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
i用于在文件上传中打开新窗口。这是我的代码没有正常工作。我的问题是如何使用打开文件上传对话框点击图片
i am using for open new window in file upload.Here my code is not properly worked.My ques is how to use open the file upload dialoge box onclick the image
推荐答案
( #ctl00_ContentPlaceHolder1_DataList1_ctl00_gallery)。click( function (){
("#ctl00_ContentPlaceHolder1_DataList1_ctl00_gallery").click(function() {
( #ctl00_ContentPlaceHolder1_DataList1_ctl00_FileUpload1)。click();
});
< / script>
("#ctl00_ContentPlaceHolder1_DataList1_ctl00_FileUpload1").click(); }); </script>
<asp:DataList ID="DataList1" runat="server" RepeatDirection="Horizontal" RepeatColumns="4" width="100%">
<ItemTemplate>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="center"><asp:ImageButton ID="gallery"
ImageUrl='<%# Eval("photo_name") %>' runat="server" width="180" height="200"
CssClass="img-responsive img-thumbnail" onclick="gallery_Click" />
<asp:Label ID="imageid" runat="server" Text='<%#Eval("proimg_id") %>' Visible="false" ></asp:Label>
<asp:Label ID="userid" runat="server" Text='<%#Eval("user_id") %>' Visible="false" ></asp:Label>
</td>
<div style="display:none;" >
<asp:FileUpload ID="FileUpload1" runat="server" />
</div>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
i用于在文件上传中打开新窗口。这是我的代码没有正常工作。我的问题是如何使用打开文件上传对话框点击图片
i am using for open new window in file upload.Here my code is not properly worked.My ques is how to use open the file upload dialoge box onclick the image
I认为你想要显示表单,而不是触发点击事件它。您可以尝试以下代码,
I think you wanted to display the form, not trigger a click event on it. You can try this following code for that,
// Upon click on the element with ID gallery
这篇关于Jquery不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文