显示/隐藏div [英] Showing/Hiding div

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

问题描述

我在vs 2005上使用asp.net ajax控件工具包1.0.我正在使用crashableablePanel和AlwaysVisibleControlExtender控件.当我使用这些按钮时,我注意到面板在隐藏之前会闪烁几秒钟.

I am using asp.net ajax control toolkit 1.0 on vs 2005. I am using the collapseablePanel and AlwaysVisibleControlExtender control. When I use these, I notice that it my panel flashes for a few seconds before it is hidden.

为避免这种情况,我决定将其放在div中以使其隐藏.我希望在使用控件时显示它.

To avoid this, I have decided to place it in a div to make it hidden. I want it shown when I use the control.

这就是我所拥有的:

<div id="menuContent" style="display:none">

 <asp:Panel ID="pnlAddNewContent" runat="server" Width="300px">
   ....//the panel stuff here
 </asp>
</div>

,标头中的javascript是:

and the javascript for this in the header is:

    function showdiv() { 
    if (document.getElementbyId) {
        document.getElementbyId('menuContent').style.visibility = 'visible'; 
    } 

    } 

(对于IE 6,我并不在乎兼容性)

(its for IE 6 for I don't care about compatability)

and body onload = onLoad ="showdiv();"

and body onload=onLoad="showdiv();"

它在加载时正确隐藏,但是我无法再次显示它.有人有解决方案吗?

It correctly hides upon load, but I cannot get it to show again. Does anyone have solutions?

推荐答案

基本上必须使用可见性"隐藏和可见属性,因为这些属性在塌陷面板上效果最佳

Basically had to use Visibility hidden and visible attributes as these work best on a collapsePanel

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

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