Jquery array remove
程序员文章站
2022-05-25 19:34:04
...
Array.prototype.remove = function(el){ return this.splice(this.indexOf(el),1); } var arr = [1,2,3,4,5]; arr.remove(4); console.log(arr);//[1,2,3,5] var array = [1,2,3,4,5]; array.splice(2,1); console.log(array);//[1,2,4,5] y.splice( $.inArray(removeItem, y), 1 ); $(window).load(function () { // run code }); $('img.userIcon').load(function(){ if($(this).height() > 100) { $(this).addClass('bigImg'); } });
http://forum.jquery.com/topic/document-ready-and-window-onload-difference