# turn.js 3rd release, local maintenance fork turn.js is a jQuery plugin that renders HTML pages as a book or magazine with a page-turn transition. This repository contains a maintained local copy of the original `turn.js` 3rd release. The current work focuses on making the library easier to test and safer to use with modern jQuery versions while keeping the original API shape. French version: [README.fr.md](README.fr.md) ## Current Status This fork has been smoke-tested with jQuery `4.0.0` in the minimal demo and covered by automated unit and visual tests. The core plugin can initialize, navigate, resize, add/remove pages, and destroy itself in modern browser test runs. Compatibility is not yet guaranteed for every modern browser or device. Safari/WebKit, iOS, Android touch behavior, accessibility, and production visual regressions still need dedicated validation. ## What Changed - Updated internal event registration from deprecated jQuery `.bind()` / `.unbind()` patterns to `.on()` / `.off()`. - Added event namespaces: - `.turn` for book-level and document-level turn.js events. - `.turnFlip` for internal flip-page events. - Added a public `destroy` method: - stops animations; - detaches turn.js event handlers; - removes turn and flip wrappers; - restores original page elements as direct children; - restores original `style` and `class` attributes; - removes turn.js internal jQuery data while preserving unrelated user data. - Fixed `animatef(false)` so cancelling an animation clears the active interval. - Added a minimal browser demo using jQuery `4.0.0`. - Added text and local images to the minimal demo. - Fixed minimal demo layout so turn.js page measurements match the real rendered page size. - Added unit tests with Vitest and JSDOM. - Added Playwright visual tests and reference snapshots for the minimal demo. - Added npm scripts and project configuration for automated tests. - Regenerated `turn.min.js` from the updated source. ## Demo Open the minimal demo directly in a browser: ```bash xdg-open demos/minimal/index.html ``` The demo loads: - jQuery `4.0.0` from the jQuery CDN; - `../../turn.js`; - local image assets from `demos/minimal/assets`. It includes a six-page book, previous/next controls, keyboard navigation, text, and images. ## Installation for Development Install dependencies: ```bash npm install ``` The development dependencies include: - `jquery` `4.0.0`; - `vitest`; - `jsdom`; - `@playwright/test`. ## Usage Basic HTML: ```html