danielstocks / jQuery-Collapse

A lightweight (~1kb) jQuery plugin that enables expanding and collapsing content
http://webcloud.se/jQuery-Collapse/
MIT License
679 stars 153 forks source link

Fire Plugin on span #52

Closed NunoBentes closed 10 years ago

NunoBentes commented 11 years ago

Hi All

How can i have this situation working? I mean fire the plugin on a span!!!

Many thanks in advance, Legues

```<script>
$(document).ready(function() {
    new jQueryCollapse($("#custom-show-hide-example"), {

      open: function() {
        this.slideDown(150);
      },
      close: function() {
        this.slideUp(150);
      },
      query: ".teste span.open",
      accordion: true
    });
    });
  </script>```

`

Hello Test
    <div>
        <p>Hello Sir.</p>
        <p>I'm sliding</p>
    </div>
<div class="test"><a href="http://www.someurl.com">Hello</a> <span class="open">Test</span></div>
    <div>I like tea</div>
<div class="test"><a href="http://www.someurl.com">Hello</a> <span class="open">Test</span></div>
    <div>This is some information</div>
</div>`
athieriot commented 10 years ago

Brilliant!

Thank you.