I used this selector in a function and I don’t even know exactly what it means, but it worked – here is my piece of code:
else if($(this).hasClass('list')) {
listItem.stop(true,true).fadeOut(333, function(){
var $this = $(this);
if(listItem.hasClass('grid')) {
$this.find('h1', this).insertBefore($this.children());
}
You can use a context in the
$()function, like this:It will then only search among the decendants of the element that
thisreferens to.It’s equivalent to using the
findmethod:Using
findwith two parameters is pointless, though. It will only ignore the second parameter.