Blog Content

    티스토리 뷰

    52.jQuery - animate 메서드로 다중 효과 구현 ( 08.Effects )

    반응형
    animate() : 여러개의 애니메이션 효과를 동시 부여
    http://docs.jquery.com :  참고하기
    05.Animate.htm

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

        <title>여러가지 효과 동시 처리</title>

        <style type="text/css">

            #my .hover

            {

                cursor:pointer;

                background-color:Yellow;

            }

        </style>

       

        <script src="../jQuery/jquery-1.3.2-vsdoc2.js" type="text/javascript"></script>

        <script type="text/javascript">

            $(document).ready(function() {

                $("#moreRegion").hide(); //기본값으로 숨기기

                $("span.more").click(function() {               

                    $("#moreRegion").animate({

                        height: '200px', width: 'show', opacity: 'show'

                    }, 'slow');

                    $(this).hide('fast');

                });

            });

        </script>

    </head>

     

    <body>

            <div class="region">

                  안녕하세요. 여기는 본문입니다.

            <span class="more">more...</span></div>

           

            <div id="moreRegion" style="height:100px; background-color:Yellow;">

                  만나요

            </div>

    </body>

    </html>


    결과화면

    [그림52-1]

    more 클릭시 대각선으로 영역이 나타납니다.


    반응형

    Comments