개발자님에게 제이쿼리 질문좀 드립니다.

아래 제이쿼리 소스가 어던때 쓰이나요?
input textarea 에 쓰이는것 같은데..
예제좀 알수 있을까요?
여기에 어떻게 사용하는지?
<input name=test itemname="예제" value="">

jQuery(function(){
    // Help Toggle
    $('.item>.iHelp').click(function(){
        $(this).parent('.item').find('.iDesc').toggleClass('hide');
    });
    // Input Clear
    var iText = $('.item>.iLabel').next('.iText');
    $('.item>.iLabel').css('position','absolute');
    iText
        .focus(function(){
            $(this).prev('.iLabel').css('visibility','hidden');
        })
        .blur(function(){
            if($(this).val() == ''){
                $(this).prev('.iLabel').css('visibility','visible');
            } else {
                $(this).prev('.iLabel').css('visibility','hidden');
            }
        })
        .change(function(){
            if($(this).val() == ''){
                $(this).prev('.iLabel').css('visibility','visible');
            } else {
                $(this).prev('.iLabel').css('visibility','hidden');
            }
        })
        .blur();
});
[이 게시물은 관리자님에 의해 2011-09-07 21:18:55 나는 7ㅐ발자다에서 이동 됨]
[이 게시물은 관리자님에 의해 2011-10-31 16:55:28 jQuery에서 이동 됨]
|

댓글 1개

visiblilty를 쓰는 건 안 좋은데 이건 고쳐서 쓰시고(show와 hide를 쓰는 게 좋습니다),

앞의 몇 줄을 제외하면 텍스트가 입력되면 label을 숨기고, 입력된 게 없으면 label을 드러내는 코드입니다.
댓글을 작성하시려면 로그인이 필요합니다.

팁게시판

디자인과 관련된 유용한 정보를 공유하세요. 질문은 상단의 QA에서 해주시기 바랍니다.

+
제목 글쓴이 날짜 조회
14년 전 조회 1,045
14년 전 조회 1,894
14년 전 조회 3,208
14년 전 조회 1,448
14년 전 조회 2,381
14년 전 조회 1,871
14년 전 조회 1,764
14년 전 조회 942
14년 전 조회 484
14년 전 조회 765
14년 전 조회 930
14년 전 조회 1,049
14년 전 조회 784
14년 전 조회 986
14년 전 조회 763
14년 전 조회 897
14년 전 조회 1,127
14년 전 조회 606
14년 전 조회 1,651
14년 전 조회 948
14년 전 조회 1,624
14년 전 조회 824
14년 전 조회 1,013
14년 전 조회 940
14년 전 조회 1,074