summaryrefslogtreecommitdiffstats
path: root/example/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'example/index.html')
-rw-r--r--example/index.html14
1 files changed, 10 insertions, 4 deletions
diff --git a/example/index.html b/example/index.html
index fa009dc..0c2505f 100644
--- a/example/index.html
+++ b/example/index.html
@@ -1,16 +1,22 @@
<!DOCTYPE html>
<html>
<head>
- <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
- <script src="../jquery.once.min.js"></script>
+ <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
+ <script src="../jquery.once.js"></script>
</head>
<body>
<h1>jQuery Once</h1>
- <p>This is some text, which is turned green only once.</p>
+ <p>This is some text, which should stay green.</p>
<script>
- $('p').once('greenify', function() {
+ // Change the color of the text to green.
+ $('p').once('changecolor', function() {
$(this).css('color', 'green');
});
+
+ // Attempt to change the color again.
+ $('p').once('changecolor', function() {
+ $(this).css('color', 'red');
+ });
</script>
</body>
</html>