![]() |
#1 |
Enthusiast
![]() ![]() Posts: 27
Karma: 110
Join Date: Dec 2010
Location: Chicago, IL
Device: iPad, Kindle
|
Javascript in Fixed Layout epubs
Is anyone using Javascript to add interactivity to their ebooks? Even something as simple as button actions?
I'm looking for resources -- books or forums -- where knowledgeable interactive epub devs hang out. Or at least, where posting a JS question specific to an epub project has a chance of being answered ;-) Thanks! AM |
![]() |
![]() |
![]() |
#2 |
the rook, bossing Never.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,011
Karma: 75135251
Join Date: Jun 2017
Location: Ireland
Device: Both Kinds: epub based makes and Kindle
|
Pointless.
Also PDF is far better for fixed layout. Anyone with a big enough screen can read it. Do an iOS/Android app if you want interactive, and don't make it fixed layout. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 71,858
Karma: 122094779
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#4 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,156
Karma: 4567890
Join Date: Nov 2009
Device: many
|
I completely disagree with both earlier responses to your question.
Some people do use JS for interactivity in epubs. I believe I have a travel book epub3 someplace that uses JS to do some interesting things. If I can find it I will post it for you so you can see some examples. |
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 26,995
Karma: 190413648
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
The knee-jerk adverse reaction to anything/anyone mentioning "interactivity" in epubs is tiresome. Text-based novels are not going to go extinct just because some interactive epubs get sold. There's room for both. Relax.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Member
![]() Posts: 12
Karma: 10
Join Date: Aug 2023
Location: NW US
Device: none
|
JS in Epub3 is useful for the designer -- so long as you're ebook is aimed to specific marketplaces (iOS Apple, Kobo marketplace, etc - but not KDP), using EPUB3 code.
Your chosen end user group is also key (is it a person sitting in a room reading an eBook late at night, or a person out walking along a hiking trail needing to look at their cell phone at the eBook for further information, or a photo gallery ebook). If its just a person reading general fiction at home, or old books converted to epub, then that group of persons may not need anything more than Epub2 code, and a generic eReader device. That being said, posting here at MobileRead (posting with the post heading specifically mentioning JS code). Other sites out there: ebooks.stackexchange, or at stackoverflow (at epub3 tags). Posting here on MobileRead has many Epub2 coders, and a core that code for Epub3 (using it in its basic form w/o touching its more extensive potential). But for those epub designers who create new designed ebooks loaded with imagery, loaded with technical information intended for a user such as a sports based ebook -- then JS code certainly can be useful to the epub designer. Start a new post page somewhere in ethernet world and we'd be interested to read your posts about epub JS code. |
![]() |
![]() |
![]() |
#7 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,465
Karma: 6095013
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
JS in epub, in some cases, is essential. For example, to format poetry. Also, I use JS to add fleurons at the end of a chapter according to the "free space" between the last line of text in the chapter and the the end of the ereader screen. If the space is big, then a fleuron is added. JS detect is the size of the font has changed and, according to that, it can add fleurons where there was not any, and remove some others (because blank spaces have changed with the change of the font size). More over, it's possible to give with JS practically a full format to text coded only with html tags (all styles are applied by the script) althought I must say that I prefer to style "by hand". And also you can add hyphens with JS (hyphenator is pure javascript).
|
![]() |
![]() |
![]() |
#8 | |
the rook, bossing Never.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,011
Karma: 75135251
Join Date: Jun 2017
Location: Ireland
Device: Both Kinds: epub based makes and Kindle
|
Quote:
Giving yourself extra work for a negative benefit. |
|
![]() |
![]() |
![]() |
#9 | |
the rook, bossing Never.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,011
Karma: 75135251
Join Date: Jun 2017
Location: Ireland
Device: Both Kinds: epub based makes and Kindle
|
Quote:
All the arguments against Action Script and Flash even more so apply to epub with Javascript. It and other multimedia should never have been in epub3. Better tools for the job. |
|
![]() |
![]() |
![]() |
#10 | |
the rook, bossing Never.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,011
Karma: 75135251
Join Date: Jun 2017
Location: Ireland
Device: Both Kinds: epub based makes and Kindle
|
Quote:
Of course it's possible, that doesn't mean it's the best solution. |
|
![]() |
![]() |
![]() |
#11 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 26,995
Karma: 190413648
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Yada, yada. Blah, blah, blah. Your arguments against remain unconvincing, and smack of "you kids get off my lawn." You shouldn't care so much. Someone else's potential failure to do things "right" will not bring the whole works crashing down. We don't need a "keep your interactivity outta our epub" police force.
|
![]() |
![]() |
![]() |
#12 |
the rook, bossing Never.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,011
Karma: 75135251
Join Date: Jun 2017
Location: Ireland
Device: Both Kinds: epub based makes and Kindle
|
I don't care much. If I cared much I'd encourage it as it reduces competition. People are free to do it, but if they want a bigger market and more flexibility there are better routes to interactive than epub3.
|
![]() |
![]() |
![]() |
#13 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 26,995
Karma: 190413648
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
![]() |
![]() |
![]() |
#14 |
Enthusiast
![]() ![]() Posts: 27
Karma: 110
Join Date: Dec 2010
Location: Chicago, IL
Device: iPad, Kindle
|
|
![]() |
![]() |
![]() |
#15 |
Enthusiast
![]() ![]() Posts: 27
Karma: 110
Join Date: Dec 2010
Location: Chicago, IL
Device: iPad, Kindle
|
Some great responses here, thank you, along with some head-scratchers (e.g. use PDF instead)...
One reason I posted here is because I'm asked about Javascript in ebooks a lot, as I teach InDesign > EPUB and have a few video courses on it. I don't cover coding really, other than demo-ing Sigil and Calibre and BBEdit should the intrepid ebook designer want to try their hand at it. The latest question from a user had to do with preventing the ereader from interpreting a tap on a button in an FXL as a tap to move to the next page. He reported back that he found the solution in the Kobo documentation on github, in the Javascript section, which apparently also works for Books app. https://github.com/kobolabs/epub-spe...script-support Sharing that here because I found it it interesting that Kobo covers it at all. |
![]() |
![]() |
![]() |
Tags |
fixed layout epub 3, javascript |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to export PDFs as Fixed-Layout ePubs in Calibre? | garethd | Conversion | 10 | 09-10-2023 02:33 PM |
'Polish Book' on fixed-layout ePubs | ownedbycats | Calibre | 3 | 03-25-2022 10:20 PM |
Fixed Layout | odedta | ePub | 2 | 03-03-2016 02:05 PM |
Text within Graphics in Fixed Layout ePubs | verydeepwater | ePub | 4 | 01-23-2013 02:34 PM |
Fixed layout epubs | misstamlin | ePub | 3 | 05-19-2011 02:28 AM |