首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >jQuery手风琴展示会

问jQuery手风琴展示会
EN

Stack Overflow用户
提问于 2012-01-12 15:54:06
回答 1查看 325关注 0票数 0

更新:对不起-我是个傻瓜。显示:块保留在div的样式中。

我有一个ASP.Net页面,在该页面中,我构建了一个应该显示为手风琴的HTML。这是可行的,但页面呈现手风琴与所有面板展开。

在编写HTML之后,我是否可以将面板重置为所有折叠的面板?

代码语言:javascript
复制
        System.Text.StringBuilder b = new System.Text.StringBuilder();
        Condition[] conditions = SearchConditions(searchFor.Text);
        b.Append("<div id=\"ac1\" class=\"accordion\">");

        foreach (Condition c in conditions)
        {
            b.Append("    <h2>" + c.ConditionName + "<br /><span style=\"font-size:x-small\">" + c.Information + "</span></h2>" + Environment.NewLine) ;
            b.Append("    <div class=\"pane\" style=\"display:block; font-size:x-small\">" + Environment.NewLine);
            b.Append("        " + c.ConditionDescription + " <br /><br />" + Environment.NewLine);
            if (c.ConditionInstructions.Length > 0)
            {
                b.Append("        <div class=\"message error\">");
                b.Append("            <strong>Important:</strong><br />");
                b.Append("            " + c.ConditionInstructions + "");
                b.Append("        </div>");
                b.Append("        <br />");
            }
            b.Append("        <a href=\"#\">Add Condition</a>" + Environment.NewLine);
            b.Append("    </div>" + Environment.NewLine);   
        }
        b.Append("</div>");

        searchResults.Text = b.ToString();

searchResults.Text是页上的ASP:文字控件。

EN

回答 1

Stack Overflow用户

发布于 2012-01-12 15:59:34

如果没有正确导入手风琴的jquery/css,则可能会发生这种情况。验证一下,您是否在页面中包含了jquery手风琴脚本和css。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8838027

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档