jquery-nextUntil
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jquery-nextUntil相关的知识,希望对你有一定的参考价值。
Then, your code should look like this ...$(document).ready(function() {
$("dt > a").click(function(){
$(this).parent().nextUntil('dt').toggle();
return false;
});
});
/******** next until > ****************/ $.fn.nextUntil = function(expr) { var match = []; // We need to figure out which elements to push onto the array this.each(function(){ // Traverse through the sibling nodes for( var i = this.nextSibling; i; i = i.nextSibling ) { // Make sure that we're only dealing with elements if ( i.nodeType != 1 ) continue; // If we find a match then we need to stop if ( jQuery.filter( expr, [i] ).r.length ) break; // Otherwise, add it on to the stack match.push( i ); } }); return this.pushStack( match, arguments ); }; /******** < next until ****************/
以上是关于jquery-nextUntil的主要内容,如果未能解决你的问题,请参考以下文章