第一次访问页面时如何保持手风琴打开? [英] How to keep accordion open when we first time visit the page ?

查看:78
本文介绍了第一次访问页面时如何保持手风琴打开?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hii,





我创建了一个手风琴,其中我已经显示了一个gridview ..我也写了jquery for点击事件..当我们点击手风琴时它会被打开然后当我们第二次点击时它再次变得紧张...





什么我想要的是..我已经在主页上发布了这个..所以当主页打开时我想要开放式的手风琴..没有关闭..





这是我的jquery



Hii,


I have create an accordion in which in which i have displayed an gridview .. i also write jquery for click event .. when we click on accordion it gets open and then again it gets cloced when we click second time ..


what i want is .. I have vreated this on home page .. so when home page is open i want that accordion in open format .. no in close..


this is my jquery

$(document).ready(function () {

            //$(".accordion2 h3").eq(2).addClass("active");
            //$(".accordion2 p").eq(2).show();

            $(".accordion2 h3").click(function () {
                $(this).next("p").slideToggle("slow")
        .siblings("p:visible").slideUp("slow");
                $(this).toggleClass("active");
                $(this).siblings("h3").removeClass("active");
            });
            $("#<%=pCommentHeaderJobHoldersReview.ClientID%>").click(function () {
                $("#<%=pCommentBodyJobHoldersReview.ClientID%>").slideToggle("normal", function () {
                    // add callback for once the toggle has occured
                    if ($("#<%=pCommentBodyJobHoldersReview.ClientID%>").css("display") == "block") { // is the div showing?
                        $("#<%=imgAddCommnetJobHoldersReview.ClientID%>").attr("src", "../images/open.gif");
                    } else { // is the div hidden?
                        $("#<%=imgAddCommnetJobHoldersReview.ClientID%>").attr("src", "../images/closed.gif");
                    }
                });
            });

        });

推荐答案

(document).ready(function(){

//
(document).ready(function () { //


(。accordion2 h3)。eq(2).addClass(active);
//
(".accordion2 h3").eq(2).addClass("active"); //


(。accordion2 p)。eq(2).show();
(".accordion2 p").eq(2).show();


这篇关于第一次访问页面时如何保持手风琴打开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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