Skip to content

Document safe dynamic reflection updates - #50

Draft
vanderlee wants to merge 1 commit into
masterfrom
agent/document-dynamic-reflections
Draft

Document safe dynamic reflection updates#50
vanderlee wants to merge 1 commit into
masterfrom
agent/document-dynamic-reflections

Conversation

@vanderlee

Copy link
Copy Markdown
Owner

Summary

  • document how to add covers dynamically without losing reflections
  • provide a complete append, reflect, and refresh example
  • warn against rewriting the coverflow's innerHTML

Why

The pattern in issue #14 reads and rewrites the container's entire innerHTML. That recreates every cover and reflection node. Canvas pixel content is not represented in serialized HTML, and the reflection plugin's jQuery state is attached to the original DOM nodes, so neither can survive that replacement.

Appending the new image in place preserves all existing nodes. Applying the reflection plugin to only the new image before calling coverflow('refresh') integrates it with the existing reflected covers.

Closes #14.

Validation

  • node --check jquery.coverflow.js
  • git diff --check
  • verified the example preserves existing DOM nodes and initializes the new reflection before refresh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Updating the innerHTML of the 'preview-coverflow' erases the reflections of the covers

1 participant