asp.net datalist onmouseover隐藏显示div或面板 [英] asp.net datalist onmouseover hide show div or panel

查看:64
本文介绍了asp.net datalist onmouseover隐藏显示div或面板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个datalist,onmouseover我想在底部显示一些链接并隐藏在mouseout中

完全像

http://www.yellowpages.com/dallas -tx / meat-packing



我想隐藏第二个面板(id-Panel1),如下图所示。请帮助,紧急



i have a datalist, onmouseover i want to show some links at bottom and hide in mouseout
exactly like
http://www.yellowpages.com/dallas-tx/meat-packing

I want to hide second panel(id- Panel1) present in the first one as shown below. Please help, its urgent

 <asp:DataList ID="dListItems" runat="server"  ForeColor="Navy" 

                    Width="100%" OnItemDataBound="datalist_ItemDataBound">
                <itemtemplate>                
                <asp:Panel ID="Container" runat="server" onmouseover = "document.getElementById('<%=Panel1.ClientID%>').style.display = 'block' "

                 onmouseout = "document.getElementById('<%=Panel1.ClientID%>').style.display = 'none' ">
<table  runat="server"   width="100%" cellpadding="0" cellspacing="0" style="border: 1px solid #FFFFFF">
                            <tr>
                            <td bgcolor="#0269cb" style="height: 2px;" align="center" valign="middle">
                                     
                                <asp:Table ID="Table1" runat="server" BackImageUrl="~/images/number_back.gif" Width="20px">
                                <asp:TableRow>
                                <asp:TableCell HorizontalAlign="Center">
                                    <asp:Label ID="Label7" runat="server" Font-Size="X-Small">                      
     
                            </td>
                                <td bgcolor="#0269cb" style="height: 2px; ">  
                                    <asp:HyperLink ID="HyperLink1" runat="server" Font-Bold="true" Font-Underline="false"

                                        ForeColor="white" NavigateUrl='<%# Eval("id","~/Catlog.aspx?id={0}") %>'><%#Eval("title") %> <br />                                </td>
                                <td bgcolor="#0269cb" align="right">
                                   <asp:LinkButton ID="LinkButton1" runat="server" 

            PostBackUrl="http://www.google.com">
                                    
                                    </td>
                            </tr>
    
                            <tr>
                                <td colspan="3" style="font-size: 9pt; font-family: Arial; text-align: left;">
                                    <br />
                                   <%--'<%# Highlight(Eval("dis").ToString()) %>'--%>
                                    <asp:Label ID="Label6" runat="server" ><%# Eval("dis")%>
                                     <br />                                </td>
                            </tr>
                            <tr>
                                <td style="color: gray; font-size: 10pt; font-family: Arial; width: 10%;">
                                    Address :</td>
                                <td align="left" style="width: 50%; font-size: 9pt; color: #663333; font-family: Arial;">
                                    <%# Eval("xdd") %>
                                    <br />                                </td>
                                <td rowspan="15" style="width: 40%;">
                                    <asp:Panel ID="pnl2" runat="server" Width="100%">
                                        <table cellpadding="0" cellspacing="0" width="100%">
                                            <tr>
                                                <td align="center" valign="middle" style="font-size: small">
                                                    <asp:Image ID="Image2" runat="server" Height="100px" AlternateText="Image Not Available " ImageUrl='<%#"~/myphoto1.ashx?Id=" +  Eval("id2") %>'

                                                        Width="100px" /></td>
                                            </tr>
                                        </table>
                                                                    </td>
                            </tr>
                            <tr>
                                <td style="color: gray; font-size: 10pt; font-family: Arial; width: 10%;">
                                    Phone :                                </td>
                                <td align="left" style="width: 50%; font-size: 9pt; color: #663333; font-family: Arial;">
                                    <%# Eval("ph") %>                                </td>
                            </tr>
                            <tr>
                                <td style="color: gray; font-size: 10pt; font-family: Arial; width: 10%;">
                                    Fax :                                </td>
                                <td align="left" style="width: 50%; font-size: 9pt; color: #663333; font-family: Arial;">
                                    &lt;%# Eval("sta")%&gt;                                </td>
                            </tr>
                            <tr>
                                <td style="color: gray; font-size: 10pt; font-family: Arial; width: 13%;">
                                    website :                                </td>
                                <td align="left" style="width: 60%; font-size: 9pt; color: #663333; font-family: Arial;">
                                    &lt;asp:HyperLink ID="hk1" runat="server" NavigateUrl='&lt;%# Eval("id","~/new_catalog/home.aspx?userid={0}") %&gt;'
                                        Style="font-size: 9pt; color: #663333; font-family: Arial;"&gt;&lt;%# Eval("catalog") %&gt;<br />                                
                                        </td>
                            </tr>
                         
                            <tr>
                                <td style="width: 10%;">                                </td>
                                <td style="width: 50%;">
                                  &lt;asp:Panel ID="Panel1" runat="server" &gt;   
                                    &lt;asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl='&lt;%# Eval("id","~/Catlog.aspx?id={0}") %&gt;'
                                        Style="font-size: 9pt; font-family: Arial;"&gt;View Catalog
                                    &nbsp;
                                    &lt;asp:HyperLink ID="HyperLink4" runat="server" NavigateUrl='&lt;%# Eval("id","~/new_catalog/home.aspx?userid={0}") %&gt;'
                                        Style="font-size: 9pt; font-family: Arial;"&gt;View Details
                                        &nbsp;
                                    &lt;asp:HyperLink ID="HyperLink5" runat="server" NavigateUrl='&lt;%# Eval("id","~/enquiry_form.aspx?id={0}") %&gt;'
                                        Style="font-size: 9pt; font-family: Arial;"&gt;Send Enquiry
                                          
                                        </td>
                                <td style="width: 30%;">                                </td>
                            </tr>

                        
                
                
                
                <table width="100%">
               
                </table>                                   
                </itemtemplate>

推荐答案

http://humrahimcs.wordpress.com/2011/07/22/creating-collapsible-detail-regions-in-a-repeater/[^]


(link doesnt work for me so i dont know exactly what you need. the answer is generic)

ASP stands for \"Active Server Pages\". As the Name implies, it always needs interaction with a Server to apply changes. So you would need to add a postback-event to the onhover, add the divs on server, send it again to the browser and render it.

Better Solution: Use JavaScript and AJAX (for easy use try jQuery)
(link doesnt work for me so i dont know exactly what you need. the answer is generic)
ASP stands for "Active Server Pages". As the Name implies, it always needs interaction with a Server to apply changes. So you would need to add a postback-event to the onhover, add the divs on server, send it again to the browser and render it.
Better Solution: Use JavaScript and AJAX (for easy use try jQuery)


这篇关于asp.net datalist onmouseover隐藏显示div或面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆