鼠标悬停在datalist border datalist中的事件不起作用

时间:2012-11-10 05:39:39

标签: asp.net datalist

我有一个显示来自sql server的图像的datalist。在数据列表控件中我有

 <asp:DataList ID="datalist1" runat="server" RepeatDirection="Horizontal" 
    RepeatColumns="3" CellPadding="1" CellSpacing="25" >
   <ItemTemplate>
     <table style="width:178px;">
        <tr>
            <td ID="img1">
             <div id="smalldiv">
               <img id="imgitem" src="allproducts.ashx?autoid=<%# Eval("AutoId").ToString() %>" onmouseover="zoomimg();"  onmouseout="zoomout();" alt="" width="180px" height="220px"/>
               <asp:Label id="lblprice" runat="server"  Text='<%#"("+ Eval("Price").ToString() + " )"%>'></asp:Label>
               <asp:HyperLink id="Linksml" runat="server" NavigateUrl="~/Presentation/home.aspx.cs">HyperLink</asp:HyperLink>
              </div>
            </td>
        </tr>
    </table>
   </ItemTemplate>         
   </asp:DataList>

仅缩放第一张图像。

它的脚本

    function zoomimg() {
    document.getElementById('img1').style.border = "1px solid black";
    //document.getElementById('bigdiv').style.display = "block";
}
function zoomout() {
    document.getElementById('img1').style.border = "none";

// document.getElementById('bigdiv')。style.display =“none”;    }

0 个答案:

没有答案