1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-04 15:09:16 +02:00

fix width and height of iframes for mobile sized browsers

This commit is contained in:
Fred Chasen 2014-01-26 17:31:45 -08:00
parent a2180ce924
commit 96ada6783b
4 changed files with 71 additions and 38 deletions

View file

@ -103,9 +103,10 @@ body {
max-width: 1250px;
/* z-index: 2;
position: absolute; */
overflow: hidden;
}
#viewer iframe {
#viewer #epubjs-iframe {
border: none;
}
@ -659,26 +660,56 @@ input:-moz-placeholder {
}
}
[class^="icon-"]:before, [class*=" icon-"]:before {
font-family: "fontello";
font-style: normal;
font-weight: normal;
speak: none;
display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: .2em;
text-align: center;
/* opacity: .8; */
/* For iPad portrait layouts only */
@media only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation: portrait) {
#viewer #epubjs-iframe {
width: 460px;
height: 740px;
}
}
/*For iPad landscape layouts only */
@media only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation: landscape) {
#viewer #epubjs-iframe {
width: 460px;
height: 415px;
}
}
/* For iPhone portrait layouts only */
@media only screen and (max-device-width: 480px) and (orientation: portrait) {
#viewer #epubjs-iframe {
width: 256px;
height: 368px;
}
}
/* For iPhone landscape layouts only */
@media only screen and (max-device-width: 480px) and (orientation: landscape) {
#viewer #epubjs-iframe {
width: 256px;
height: 124px;
}
}
/* For safety - reset parent styles, that can break glyph codes*/
font-variant: normal;
text-transform: none;
[class^="icon-"]:before, [class*=" icon-"]:before {
font-family: "fontello";
font-style: normal;
font-weight: normal;
speak: none;
/* you can be more comfortable with increased icons size */
font-size: 112%;
}
display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: .2em;
text-align: center;
/* opacity: .8; */
/* For safety - reset parent styles, that can break glyph codes*/
font-variant: normal;
text-transform: none;
/* you can be more comfortable with increased icons size */
font-size: 112%;
}
.icon-search:before { content: '\e807'; } /* '' */
@ -703,3 +734,4 @@ input:-moz-placeholder {
.icon-columns:before { content: '\e810'; } /* '' */
.icon-list:before { content: '\e800'; } /* '' */
.icon-resize-small:before { content: '\e808'; } /* '' */

View file

@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<meta name="viewport" content="width=device-width, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="stylesheet" href="../demo/css/normalize.css">

View file

@ -42,19 +42,20 @@ EPUBJS.reader.ControlsController = function(book) {
screenfull.toggle($('#container')[0]);
});
document.addEventListener(screenfull.raw.fullscreenchange, function() {
fullscreen = screenfull.isFullscreen;
if(fullscreen) {
$fullscreen
.addClass("icon-resize-small")
.removeClass("icon-resize-full");
} else {
$fullscreen
.addClass("icon-resize-full")
.removeClass("icon-resize-small");
}
});
if(screenfull) {
document.addEventListener(screenfull.raw.fullscreenchange, function() {
fullscreen = screenfull.isFullscreen;
if(fullscreen) {
$fullscreen
.addClass("icon-resize-small")
.removeClass("icon-resize-full");
} else {
$fullscreen
.addClass("icon-resize-full")
.removeClass("icon-resize-small");
}
});
}
$settings.on("click", function() {
reader.SettingsController.show();

View file

@ -57,7 +57,7 @@ EPUBJS.Reader = function(path, _options) {
reload: this.settings.reload,
contained: this.settings.contained,
bookKey: this.settings.bookKey,
styles: this.settings.styles
styles: this.settings.styles,
});
if(this.settings.previousLocationCfi) {