javascript - Borrow jQuery's show and hide -
$('.foo').each(function () { var $this = $(this); var footext = $this.text(); var displayfunction = (footext.tolowercase().indexof(filtertext.tolowercase()) != -1) ? $.show : $.hide; displayfunction.apply($this); displayfunction.apply($this.next()); } looks $.show , $.hide undefined, how can resolve this?
use $.fn.show , $.fn.hide.
all instances of $ inherit methods defined on $.fn, alias prototype of jquery. alternatively use $().hide there's no need create instance.
Comments
Post a Comment