jquery - Add an if statement to append() -
is possible add if
statement append()
inside jquery function ?
}).data("uiautocomplete")._renderitem = function(ul, item) { $(ul).addclass("quicksearch"); $(ul).css('margin-left','-125px'); var rating_color = item.level; var revision = item.revision.tolowercase(); //if revision === "") { append ! return $("<li></li>").data("item.autocomplete", item).append('<a><img class="clubpicture" src="'+item.clubpicture+'" /><img class="nationpicture" src="'+item.nationpicture+'" /><span class="name">'+item.name+'</span> ('+item.position+') <span class="rating '+rating_color+' '+revision+'">'+item.rating+'</span></a>').appendto(ul); };
if point me in correct direction that'd great
you hook jquery
$.fn.customif = function(){ var els = []; this.each(function(){ if( instanceof htmldivelement ){ els.push(this); } }); return $(els); };
as example. send <div>
elements on appended on to.
Comments
Post a Comment