Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,25 @@ Get the currently selected cover as a jQuery object.
Get or set the current index. If no value is provided, the current index is
returned. Otherwise, the index will be set to the provided value.

### **refresh**
Redraw the covers. You shouldn't ever need to do this unless you are adding
or removing covers or changing the covers yourself.
### **refresh**
Redraw the covers. You shouldn't ever need to do this unless you are adding
or removing covers or changing the covers yourself.

When adding covers dynamically, append the new DOM node instead of rewriting
the coverflow's `innerHTML`. Rewriting `innerHTML` recreates every existing
node, which clears canvas-based reflections and discards plugin state. Apply
the reflection plugin to the new cover before refreshing:

```js
var $cover = $('<img class="cover" src="demo/attic.jpg" alt="">')
.appendTo('#preview-coverflow');

if ($.fn.reflect) {
$cover.reflect();
}

$('#preview-coverflow').coverflow('refresh');
```

Events
------
Expand Down