README.md in parade-0.8.0 vs README.md in parade-0.8.1
- old
+ new
@@ -316,61 +316,89 @@
If you want to trigger some JavaScript as soon as a certain page is shown or
when you switch to the next or previous slide, you can bind a callback to a
custom event:
-> ### parade:show
-> will be triggered as soon as you enter a page
-> ### parade:next
-> will be triggered when you switch to the next page
-> ### parade:incr
-> will be triggered when you advance to the next increment on the page
-> ### parade:prev
-> will be triggered when you switch to the previous page
+### Appearance
+* parade:willAppear
+
+> triggered before the slide is presented
+
+* parade:didAppear
+
+> triggered after the slide is presented
+
+* parade:show
+
+### Disappearance
+
+> triggered after the slide is presented
+
+* parade:willDisappear
+
+> triggered before the slide disappears
+
+* parade:didDisappear
+
+> triggered after the slide disppeared
+
+### Navigation
+
+* parade:next
+
+> triggered when an attempt to move to the next slide or incremental bullet point
+
+* parade:prev
+
+> triggered when an attempt to move back a slide or incremental bullet point
+
+
These events are triggered on the "div.content" child of the slide, so you must
add a custom and unique class to your SLIDE to identify it:
```markdown
!SLIDE custom_and_unique_class
# 1st Example h1
<script>
// bind to custom event
-$(".custom_and_unique_class").bind("parade:show", function (event) {
+$(".custom_and_unique_class").live("parade: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);
+
+ return false;
});
</script>
```
This will bind an event handler for *parade:show* to your slide. The
h1-element will be animated, as soon as this event is triggered on that slide.
If you bind an event handler to the custom events *parade:next* or
*parade:prev*, you can prevent the default action (that is switching to the
-appropriate slide) by calling *event.preventDefault()*:
+appropriate slide) by returning *false*:
```markdown
!SLIDE prevent_default
# 2nd Example h1
<script>
-$(".prevent_default").bind("parade:next", function (event) {
+$(".prevent_default").live("parade:next", function (event) {
var h1 = $(event.target).find("h1");
if (h1.css("text-decoration") === "none") {
- event.preventDefault();
h1.css({textDecoration: "line-through"})
+ return false;
}
});
</script>
```
This will bind an event handler for *parade:next* to your slide. When you press
the right arrow key the first time, the h1-element will be decorated. When you
-press the right array key another time, you will switch to the next slide.
+press the right arrow key another time, you will switch to the next slide.
The same applies to the *parade:prev* event, of course.
## Custom Stylesheets
@@ -380,10 +408,10 @@
be applied as soon as it is loaded.
The content generated by the slide is wrapped with a *div* with the class .+content+ like this.
```html
-<div ref="intro/01_slide/1" class="content" style="margin-top: 210px;">
+<div class="content">
<h1>jQuery & Sinatra</h1>
<h2>A Classy Combination</h2>
</div>
```