View Single Post
Old 05-15-2013, 07:32 AM   #6
mzmm
Groupie
mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.
 
mzmm's Avatar
 
Posts: 171
Karma: 86271
Join Date: Feb 2012
Device: iPad, Kindle Touch, Sony PRS-T1
Quote:
Originally Posted by Doitsu View Post
You could use media queries to test for known devices for Webkit based devices/apps and/or Jellby's XPGT trick to hide styles from ADE/RMSDK based readers, which don't support media queries.
although if you were reading the ebook in a browser on a smartphone/tablet it would still hide the content.

Quote:
Originally Posted by spotrick View Post
This is more complicated than it sounds. I have some components of my ebooks that are there purely for readers using a browser. E.g. navigation at the end of a chapter. In an ePub ereader, or a Kindle, these components are redundant, so I'd like to be able to hide them.

I can use CSS display:none; -- but then I'd need to use a different stylesheet for epub than for the web.

So I'm wondering if there's a CSS hack that can be used that would only be seen by a web browser, but be ignored by epub readers. Kind of like the hacks used to make older versions of IE work.

Anyone know of any usable hacks?
are the epub's ncx or opf functional in the browser version (in an epub reading engine), or are you just displaying the book's html in the browser?

one (very extravagant) workaround might be to embed a script querying the browser, and load the browser-only css that way. i think there'd be a way for you could target userAgent safari and userAgent chrome to avoid loading your css on webkit-based readers, and you'd end up with a huge conditional statement querying specific vendors, and then defaulting to the standard epub css.

http://stackoverflow.com/questions/6...et-only-safari

there has to be an easier way though.

Last edited by mzmm; 05-15-2013 at 07:45 AM.
mzmm is offline   Reply With Quote