Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 485 Bytes

chaining.md

File metadata and controls

22 lines (15 loc) · 485 Bytes

baron() returns the baron object, even in jQuery mode. That breaks jQuery chaining. For example, you can't do this:

$('.scroller').baron().css().animate();

but you can:

$('.scroller').css().animate() // jQuery chaining
    .baron().update(); // baron chaining

and even more:

var scroll = $('.scroller').css().animate().baron().fix();

scroll.baron({direction: 'h'}).test().anotherBaronPlugin();

Every baron plugin sould return baron object (this);