View Single Post
Old 08-08-2025, 05:14 AM   #23
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,746
Karma: 24032915
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Quoth View Post
Once you add animation or interaction or video or sound, it's no longer a book. It's best done as an app and not pretending to be a book.
Creating an app instead of an epub with JavaScript is overkill. Moreover, you'd have to maintain code bases for all supported platforms.

While most reflowable fiction epubs usually don't benefit much from JavaScript, except for adding hyphenation, JavaScript can be very useful for non-fiction books, in particular textbooks.

Years ago I saw an example of an electronics textbook that contained a formula whose values could be changed.

I created a similar example that illustrates a physics formula.
(It works fine with Thorium and ADE 4.5.)

If you wanted to do this with a static epub, you'd have to add at least 4 images to illustrate how changes to the input values affect the result.

JavaScript might also be useful for other kinds of textbooks. For example, you can use it to show/hide interlinear text.

Just because you haven't seen commercial books that use JavaScript, you shouldn't flat-out deny its usefulness or keep insisting that apps are the only way to go!
Attached Thumbnails
Click image for larger version

Name:	script_example.png
Views:	25
Size:	32.8 KB
ID:	217380  
Attached Files
File Type: epub range_js_example.epub (11.9 KB, 23 views)

Last edited by Doitsu; 08-08-2025 at 06:09 AM.
Doitsu is offline   Reply With Quote