Permalink
Browse files

add example for custom events

  • Loading branch information...
Marcus Lunzenauer
Marcus Lunzenauer committed Jul 29, 2010
1 parent 43cb383 commit 2ffa3d0c58db729befe51e439eb04103125592ab
Showing with 32 additions and 1 deletion.
  1. +2 −1 example/showoff.json
  2. +30 −0 example/three/js-events.md
View
@@ -3,6 +3,7 @@
"description": "Example Presentation",
"sections": [
{"section":"one"},
- {"section":"two"}
+ {"section":"two"},
+ {"section":"three"}
]
}
View
@@ -0,0 +1,30 @@
+!SLIDE subsection
+# Custom events #
+
+!SLIDE custom_and_unique_class
+# 1st Example h1
+<script>
+// bind to custom event
+$(".custom_and_unique_class").bind("showoff:show", function (event) {
+ // animate the h1
+ var h1 = $(event.target).find("h1");
+ h1.delay(500)
+ .slideUp(300, function () { $(this).css({textDecoration: "line-through"}); })
+ .slideDown(300);
+});
+</script>
+
+!SLIDE prevent_default
+# 2nd Example h1
+<script>
+$(".prevent_default").bind("showoff:next", function (event) {
+ var h1 = $(event.target).find("h1");
+ if (h1.css("text-decoration") === "none") {
+ event.preventDefault();
+ h1.css({textDecoration: "line-through"})
+ }
+});
+</script>
+
+!SLIDE
+# Switched

0 comments on commit 2ffa3d0

Please sign in to comment.