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

아래 제이쿼리 소스가 어던때 쓰이나요?
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,040
14년 전 조회 1,888
14년 전 조회 3,201
14년 전 조회 1,440
14년 전 조회 2,374
14년 전 조회 1,863
14년 전 조회 1,758
14년 전 조회 935
14년 전 조회 479
14년 전 조회 758
14년 전 조회 925
14년 전 조회 1,044
14년 전 조회 779
14년 전 조회 982
14년 전 조회 759
14년 전 조회 893
14년 전 조회 1,122
14년 전 조회 602
14년 전 조회 1,647
14년 전 조회 944
14년 전 조회 1,621
14년 전 조회 820
14년 전 조회 1,008
14년 전 조회 937
14년 전 조회 1,068
🐛 버그신고