2014-11-25 76 views
-1

在此代码中,我在弹出框中显示图像。无法在弹出框中显示图像

<script type="text/javascript"> 
var content2 =document.getElementById('<%= ProfilePicture.ClientID %>'); 
T$('testclick2').onclick = function() { TINY.box.show(content2, 0, 0, 0, 1) } 

<div class="button" id="testclick2"><strong>Image</strong> - <em>click here</em></div> 
<asp:Image ID="ProfilePicture" runat="server" alt="Profile Pic" Width="200px" /> 

<asp:FileUpload ID="ProfilePictureFileUpload" runat="server"/> 
+1

变化率T $( 'testclick2')的onclick为$( '#testclick2')的onclick – Zaki 2014-11-25 11:32:58

回答

1

更改您的代码:。

<div class="button" id="example1"><strong>Image</strong> - <em>click here</em></div> 
<script type="text/javascript"> 
    T$('example1').onclick = function() { TINY.box.show('<asp:Image ID='img1' runat='server' width='100' height='100' alt='' />', 0, 0, 0, 1) } 
</script>