今回は、470行目~769行目までを解説します。 slice() 0470: slice: function() { 0471: return this.pushStack( Array.prototype.slice.apply( this, arguments ) ); 0472: }, 0473: sliceメソッドは、Arrayオブジェクトのsliceを実行しています。わざわざ別のメソッドを定義しているのは、pushStackを使って現在の状態をスタックに格納するためです。 map() 0474: map: function( callback ) { 0475: return this.pushStack( jQuery.map(this, function(elem, i){ 0476: return callback.call( elem, i, elem ); 0477:
I was watching The Last Dance, Michael Jordan’s Netflix documentary, last year when I returned to work from four-month-long paternity leave. It was a great show and brought back all of the joys I had when watching Chicago Bulls in the 90s. And it still got me to think till today, what if my engineering team were a sports team. Give this idea a shot. For an engineer in an IT company, you don’t play
[2011/03/12追記] 昔の記事だから今は見られていないかなと思ったんですが、それなりにアクセスあるようなので追記。 $('div').myMethod()みたいな感じでmyMethodという自分用の好きなメソッドを生やすのは良いのですが、 複数人でそういうことをやったりするとみんな「myMethod」というメソッド作って衝突してしまうこともあると思います。 jQuery1.5が使えるのであればjQuery.subを使ってmyMethodを閉じ込めてしまい、 衝突を避けるというのが良いかもしれません。 http://api.jquery.com/jQuery.sub/ また、たとえばtooltipに関するメソッドを生やしたい場合に、 pluginの作り方にも書いてある通り、 (function( $ ){ $.fn.tooltip = function( options ) { //
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く