• 코드:
​x
 
1
<!DOCTYPE html>
2
<html lang="ko">
3
​
4
<head>
5
    <meta charset="UTF-8">
6
    <title>jQuery jQuery.fx</title>
7
    <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
8
    <style>
9
        #divBox {
10
            width: 100px;
11
            height: 100px;
12
            background-color: yellow;
13
            border: 5px solid red;
14
            margin-top: 20px;
15
        }
16
    </style>
17
    <script>
18
        $(function() {
19
            $("#toggleBtn").on("click", function() {
20
                // id가 "divBox"인 요소를 1초에 걸쳐 올라가면서 사라지거나 내려오면서 나타나게 함.
21
                $("#divBox").slideToggle(1000);
22
            });
23
            $("#forbidBtn").on("click", function() {
24
                jQuery.fx.off = true;   // jQuery.fx 객체의 off 프로퍼티를 true로 설정함.
25
            });
26
        });
27
    </script>
28
</head>
29
​
30
<body>
31
​
32
    <h1>jQuery.fx.off 프로퍼티</h1>
33
    <button id="toggleBtn">이펙트 효과 토글!</button>
34
    <button id="forbidBtn">이펙트 효과 금지!</button>
35
    <div id="divBox"></div>
36
    
37
</body>
38
​
39
</html>