2015年2月15日日曜日

開発環境

  • OS X Yosemite - Apple (OS)
  • Safari, Firefox, Google Chrome(Webプラウザ)
  • Emacs (CUI)、BBEdit - Bare Bones Software, Inc.(GUI) (Text Editor)
  • JavaScript (プログラミング言語)

Head First jQuery(Ryan Benedetti(著)、Ronan Cranley(著)、O'Reilly Media)のChapter 5(jQuery Effects and Animation: A Little Glide in Your Stride)、SHARPEN YOUR PENCIL(No. 2670)を解いてみる。

その他参考書籍

SHARPEN YOUR PENCIL(No. 2670)

JavaScript(BBEdit, Emacs)

$(document).ready(function () {
    var headclix = 0,
        eyesclix = 0,
        noseclix = 0,
        mouthclix = 0;
    
    $('#head').click(function () {
        
        if (headclix < 9) {
            headclix += 1;
        } else {
            headclix = 0;
        }
        alert(headclix);
    });
    $('#eyes').click(function () {
        
        if (eyesclix < 9) {
            eyesclix += 1;
        } else {
            eyesclix = 0;
        }
        alert(eyesclix);
    });
    $('#nose').click(function () {
        
        if (noseclix < 9) {
            noseclix += 1;
        } else {
            noseclix = 0;
        }
        alert(noseclix);
    });
    $('#mouth').click(function () {
        
        if (mouthclix < 9) {
            mouthclix += 1;
        } else {
            mouthclix = 0;
        }
        alert(mouthclix);
    });    
});

index2670.html

0 コメント:

コメントを投稿