Posted By

MikeAcreman on 11/10/10


Tagged


Versions (?)

selectUntil


 / Published in: jQuery
 

use like this, for example: $('h2').selectUntil('h2').show()

  1. (function( $ ){
  2.  
  3. $.fn.selectUntil = function(stopper) {
  4. returnEl = this;
  5.  
  6. this.nextAll().each(function(){
  7. if($(this).is(stopper))
  8. return false;
  9. else returnEl = returnEl.add(this);
  10.  
  11. })
  12. return returnEl;
  13. };
  14. })( jQuery );

Report this snippet  

You need to login to post a comment.