English 中文(简体)
4. 简单的协定
原标题:Simple Accordion syntax

我正试图说明,纳夫纽带为何赢得一致意见。 我确信,只有一些格格不入。 我改变了《支尔克法》中的遴选人,现在赢得工作。

要确保有经过培训的眼光,这应该是快速的。

谁能帮助?





    ////////////////////////////
    // http://www.adipalaz.com/experiments/jquery/accordion.html
    ///////////////////////////
    (function($) {
    //http://www.mail-archive.com/[email protected]/msg43851.html
    $.fn.orphans = function(){
        var txt = [];
        this.each(function(){$.each(this.childNodes, function() {
            if (this.nodeType == 3 && $.trim(this.nodeValue)) txt.push(this)
        })}); 
        return $(txt);
    };
    //http://www.learningjquery.com/2008/02/simple-effects-plugins:
    $.fn.fadeToggle = function(speed, easing, callback) {
        return this.animate({opacity:  toggle }, speed, easing, callback);
    };
    $.fn.slideFadeToggle = function(speed, easing, callback) {
        return this.animate({opacity:  toggle , height:  toggle }, speed, easing, callback);
    };
    })(jQuery);
    ////////////////////////////
    $(function() {
        $( .collapse ).hide(); 
        $( .expand ).orphans().wrap(  );



        //demo 4 - div.demo:eq(3) - queued slide effects:
        $( div.demo .expand ).click(function() {
            var $thisCllps = $(this).next( .collapse );
            var $cllpsVisible = $(this).ul( .expand ).next( .collapse:visible );
            ($cllpsVisible.length) ? $(this).toggleClass( open ).siblings( .expand ).removeClass( open )
                .next( .collapse:visible ).slideUp(400, function() {
                $thisCllps.slideDown();
                }) : $thisCllps.slideToggle().prev( .expand ).toggleClass( open );
            return false;
        });


    });





    <div class="demo">


        <ul class="collapse" class="ul" style="display: none; ">
          <li>Item 1.1.</li>    
          <li>Item 1.2.</li>
        </ul>

        <ul class="collapse" class="ul" style="display: none; ">
          <li>Item 2.1.</li>    
          <li>Item 2.2.</li>
        </ul>

        <ul class="collapse" class="ul" style="display: none; ">
          <li>Item 3.1.</li>    
          <li>Item 3.2.</li>
        </ul>
    </div>
<ul>
<li>
    <h4 class="expand"><a href="#" title="expand/collapse">Slide Up/Down UL 1</a></h4>
</li>
<li>
    <h4 class="expand"><a href="#" title="expand/collapse">Slide Up/Down UL 2</a></h4>
</li>
<li>
    <h4 class="expand"><a href="#" title="expand/collapse">Slide Up/Down UL 3</a></h4>
</li>
</ul>

最佳回答

为什么不只使用吉克礼会的功能?

http://docs.jquery.com/UI/Accordion

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签