jQuery 예제 모음

시삽: 레드플러스 님 
게시판 이동:
 제목 : jQuery UI의 toggleClass 메서드로 2가지 상태로 모양을 변경하기
글번호: 3
작성자: Administrator ( 레드플러스 / redplus@live.com )
작성일: 2012/05/15 오전 5:13:12
조회수: 4291
<!DOCTYPE html>

<html lang="ko">
<head>
    <meta charset="utf-8" />
    <title>Toggle Class</title>
    <style type="text/css">
        .firstStyle { width:100px; height:100px; background-color:Yellow; border:1px solid red; left:0px; }
        .secondStyle { width:200px; height:200px; background-color:Green; border:5px solid Blue; left:200px; }
    </style>
    <script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="../js/jquery-ui-1.8.18.custom.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $('#theChange').css("position", "relative").click(function () {
                //$(this).addClass("secondStyle", "slow");
                $(this).toggleClass("secondStyle", "slow");
            });
        });
    </script>
</head>
<body>
    <h1>jQuery Effects</h1>
    <h3>Toggle Class</h3>

    <div id="theChange" class="firstStyle"></div>
</body>
</html>
 
이전 글   다음 글 삭제 수정 답변 글쓰기 리스트


관련 아티클 리스트
  제       목 파일 작성자 작성일 조회
이전글 jQuery UI의 hide 메서드로 특정 요소 없애기 - Administrator 2012-05-15 4024
현재글 jQuery UI의 toggleClass 메서드로 2가지 상태로 모양을 변경하기 - Administrator 2012-05-15 4291
다음글 jQuery UI Easing Function : 미리 정의된 32가지 효과 부여하기 - Administrator 2012-05-15 4616
 
손님 사용자 Anonymous (손님)
로그인 Home