Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 06-16-2020, 07:40 AM   #1
increase
Connoisseur
increase began at the beginning.
 
increase's Avatar
 
Posts: 86
Karma: 10
Join Date: Jan 2020
Device: kindle
Is it possible to have a back button

When reading the ebook and linking to an appendix, is it possible to have a back link to return to the pervious page?

something like history.back()
increase is offline   Reply With Quote
Old 06-16-2020, 08:01 AM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,904
Karma: 131375774
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
The back link has to be part of the eBook's code.
JSWolf is offline   Reply With Quote
Advert
Old 06-16-2020, 08:03 AM   #3
increase
Connoisseur
increase began at the beginning.
 
increase's Avatar
 
Posts: 86
Karma: 10
Join Date: Jan 2020
Device: kindle
Quote:
Originally Posted by JSWolf View Post
The back link has to be part of the eBook's code.
Thank you, do you have n example of the code for kindle?
increase is offline   Reply With Quote
Old 06-16-2020, 08:14 AM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,904
Karma: 131375774
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by increase View Post
Thank you, do you have n example of the code for kindle?
Here is code that will work.
Code:
<p class="paraNoIndent">There are many kinds of vampires. Indeed, it is said that there are as many kinds of vampires as there are types of disease.<span class="footnoteRef"><a href="9780061807862_Footnote.xhtml#footnote1" id="footnote_1">[*]</a></span> And they’re not just human (if vampires are human). All along the Ramtops may be found the belief that any apparently innocent tool, be it hammer or saw, will seek blood if left unused for more than three years. In Ghat they believe in vampire watermelons, although folklore is silent about <i>what</i> they believe about vampire watermelons. Possibly they suck back.</p>
Here is the back code.
Code:
<p class="footnote" id="footnote1"><span class="footnotePara"><a href="9780061807862_Chapter_1.xhtml#footnote_1">[*]</a> Which presumably mean that some are virulent and deadly, and others just make you walk in a funny way and avoid fruit.</span></p>
Here is the CSS code.
Code:
body {
  widows: 1;
  orphans: 1;
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 0;
  margin-left: 0;
  text-align: justify;
}
img {
  max-width: 100%;
  max-height: 100%;
}
p {
  margin-top: 0;
  margin-bottom: 0;
  text-indent: 1.2em;
}
.aboutAuthorPage {
  page-break-before: always;
}
.aboutAuthorText {
  text-align: justify;
  text-indent: 0;
  margin-top: 0;
  margin-bottom: 0.8em;
}
.chapterNumber {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
  text-align: center;
  text-indent: 0;
  font-size: large;
  font-weight: bold;
}
.chapterOpenerText {
  margin-bottom: 0;
  margin-top: 0;
  margin-left: 0;
  text-indent: 0;
}
.contentsHead {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
  text-align: center;
  text-indent: 0;
  font-size: large;
  font-weight: bold;
}
.copyrightPage {
  page-break-before: always;
}
.copyrightText {
  font-size: small;
  margin-top: 0.8em;
  font-weight: normal;
  margin-bottom: 0;
  text-indent: 0;
  text-align: justify;
}
.footnote {
  margin-bottom: 1.5em;
  font-style: normal;
  font-weight: bold;
  text-indent: 1.5em;
  text-align: justify;
}
.footnotePara {
  margin-bottom: 2em;
  font-style: normal;
  font-weight: normal;
  text-indent: 0;
  text-align: justify;
}
.footnoteRef {
  display: inline;
  font-style: normal;
  font-weight: bold;
  vertical-align: top;
}
.paraCenter {
  margin-bottom: 2%;
  text-indent: 0;
  text-align: center;
}
.paraNoIndent {
  padding-top: 2em;
  text-indent: 0;
  text-align: justify;
}
.paraNoIndent1 {
  padding-top: 1em;
  text-indent: 0;
  text-align: justify;
}
I've posted the entire CSS.

It's the use of the ID that says where the links land in the XHTML file.
JSWolf is offline   Reply With Quote
Old 06-16-2020, 08:27 AM   #5
increase
Connoisseur
increase began at the beginning.
 
increase's Avatar
 
Posts: 86
Karma: 10
Join Date: Jan 2020
Device: kindle
Not quite what I was meaning, in html history.back() returns back to the previous page in history, so if I use an xhtml link it would return to that page, not the previous page.

Seems the Walk Search History plugin is what i had in mind, but it is not available for Sigil

Last edited by increase; 06-16-2020 at 08:31 AM.
increase is offline   Reply With Quote
Advert
Old 06-16-2020, 08:36 AM   #6
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,621
Karma: 23190435
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by increase View Post
When reading the ebook and linking to an appendix, is it possible to have a back link to return to the pervious page?

something like history.back()
Theoretically, it's possible, but only in epub3 books. You can find a proof-of-concept epub3 book here.
Doitsu is offline   Reply With Quote
Old 06-16-2020, 12:24 PM   #7
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by increase View Post
Not quite what I was meaning, in html history.back() returns back to the previous page in history, so if I use an xhtml link it would return to that page, not the previous page.

Seems the Walk Search History plugin is what i had in mind, but it is not available for Sigil
history.back() is not html, it's javascript. For jumping to footnotes in html you use "a" or anchor tags, for example
Code:
<a href="#note1" id="backref1">[Note 1]</a>
The href specifies where to jump. The id gives a destination for another anchor tag to jump to; in this case it's how the return knows where to go. Here's the html at the bottom of the file for the footnote:
Code:
<a id="note1"></a>Hannibal, Missouri. (<a href="#backref1">Return to previous place.</a>
The pound/sharp sign in front of the note1 and backref1 mean that it's a specific location in the html file (the id of another anchor tag), as compared to the usual linking to an html file like you would with a web page link.

Last edited by hobnail; 06-17-2020 at 11:45 AM.
hobnail is offline   Reply With Quote
Old 06-16-2020, 12:45 PM   #8
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,904
Karma: 131375774
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Doitsu View Post
Theoretically, it's possible, but only in epub3 books. You can find a proof-of-concept epub3 book here.
Would it work in a KF8 eBook? I know it won't work in Mobi or KFX.
JSWolf is offline   Reply With Quote
Old 06-16-2020, 01:09 PM   #9
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,598
Karma: 84812983
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by JSWolf View Post
Would it work in a KF8 eBook? I know it won't work in Mobi or KFX.
No. JavaScript is not supported in KF8.

Of course on a Kindle you can just use the back button to return to your prior location.
jhowell is offline   Reply With Quote
Old 06-16-2020, 04:50 PM   #10
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,904
Karma: 131375774
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by jhowell View Post
No. JavaScript is not supported in KF8.

Of course on a Kindle you can just use the back button to return to your prior location.
You can go back to your prior location on a Kobo as well.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Back button gabaldini Calibre 2 12-30-2016 10:15 AM
Glo Back Button on Glo ? bongorash Kobo Reader 10 06-24-2013 09:04 PM
Back Button? dandichka Calibre 5 07-05-2012 12:19 PM
PRS-T1 How can I use back button as power button? younghere Sony Reader 1 03-12-2012 06:37 PM
The Back button coltrane Amazon Kindle 7 05-17-2010 10:10 AM


All times are GMT -4. The time now is 12:46 AM.


MobileRead.com is a privately owned, operated and funded community.