equalize.js 高さや幅が不揃いのDOM要素を同じ高さ・幅にします。 height, width, outer-, inner- に対応
equalize.js 高さや幅が不揃いのDOM要素を同じ高さ・幅にします。 height, width, outer-, inner- に対応
前回の解説では、クロージャの「変数が保持される」「変数が隠蔽される」という特徴を使って、アクセサメソッドを作りました。 今回は、「呼ぶたびにクロージャが生まれる」特徴を使ってみます。 繰り返し処理内でイベントハンドラを作る まずは、何の工夫もなくやってみます。今回はjQueryも使います。 $(function() { var data = [ {label:'リンク1', value:1}, {label:'リンク2', value:2}, {label:'リンク3', value:3}, {label:'リンク4', value:4}, {label:'リンク5', value:5} ]; var ul = $('<ul/>'); for(var i = 0, l = data.length; i < l; i++) { var item = data[i]; var li = $('
このコードで、 jQuery("#target").n3Cropper({ width : 150, height : 150 });
飽きてきたのでやる気が0になる前に気づいた点を公開しておく $は識別子に使えない。 jQuery.isはisがJSXの予約語なので使えない。is_とかにリネームする? jQueryがjQuery(...)もjQuery.fooもできる存在なのが厄介。僕も今の実装ではclass jQueryを作ってコンストラクタのnew jQuery(...)とstatic methodのjQuery.fooを使う形になっているけども、見た目をjQueryに似せるのをやめてjQuery(...)的な使い方は全部きちんと名前付きで呼べ(jQuery.find(...), jQuery.ready(...), etc)という方がよい気がする。 jQuery.findの返り値は[0]とかができる「Arrayのような何か」だが、これは実はArrayではないのでJSXではArrayへのキャストが出来ない。 jQuer
画像スライダーに関することならお任せ!なjQueryプラグイン「Slider Kit... 次の記事 ≫:かなりいい感じのWordPressテーマ20 Allan Jardine | Reflections | Visual Event ページに仕込まれたJavaScriptのイベントを全部見える化出来るブックマークレット「Visual Event」。 JavaScript で開発していて、jQuery等の各種フレームワークや、on〜 を使ってイベントを埋め込むことは多いですね。 後になって、どこにイベントがあるのかをすぐ見える化し、どのような処理が記述されているのか、確認することのできるブックマークのご紹介です。 当サイトにはそれほどイベントが組み込まれていませんので、Yahoo! Japanのトップページで試してみます。 ブックマークレットを起動すると、グレーアウトされ、エレメントの上
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く