简体   繁体   English

在TurnJS中添加背景色

[英]Adding background color in TurnJS

I have experienced problem I have never faced before and even googling it did not help. 我遇到了从未遇到过的问题,甚至谷歌搜索也无济于事。 I have basic code from the official page of script TurnJS , which is the problem I have with. 我有脚本TurnJS官方页面上的基本代码,这是我遇到的问题。

<div id="flipbook">
<div class="hard"> Turn.js </div>
<div class="hard"></div>
<div> Page 1 </div>
<div> Page 2 </div>
<div> Page 3 </div>
<div> Page 4 </div>
<div class="hard"></div>
<div class="hard"></div>

This works as it should but is has transparent background so when you have any text on pages it overlays themselves so you cannot read the text properly. 这可以正常工作,但背景是透明的,因此当页面上有任何文本时,它将覆盖自身,因此您无法正确阅读文本。

When I add 当我添加

#flipbook div{
    background: white;
}

It somehow breaks. 它以某种方式破裂。 Pages skew when hovered etc. I cannot insert a jsfiddle example because the link for turnjs script is not https and I am not allowed to insert http links. 悬停等时页面偏斜。我无法插入jsfiddle示例,因为turnjs脚本的链接不是https,并且不允许插入http链接。 And here it shows me error in code. 在这里,它向我显示了代码错误。 The skewed page is shown on image below. 倾斜的页面如下图所示。 Does someone know how to add a bg-color to that flipbook ? 有人知道如何向该活动簿添加bg-color吗? I would aprreciate any comments. 我将不胜感激。 TurnJS中的页面歪斜

You can add another class to your pages which specifies a background colour: 您可以在页面中添加另一种指定背景色的类:

<div id="flipbook">
<div class="hard"> Turn.js </div>
<div class="hard"></div>
<div class="pageStyle"> Page 1 </div>
<div class="pageStyle"> Page 2 </div>
<div class="pageStyle"> Page 3 </div>
...

And then specify everything you need in that class. 然后在该类中指定您需要的所有内容。 The other method is to load background images for each page. 另一种方法是为每个页面加载背景图像。 This is generally how a magazine would be created in TurnJS as it's easier to automate. 通常,这是在TurnJS中创建杂志的方式,因为它更易于自动化。 Although I just went over their docs looking for this (I know it works, I've done it before) and couldn't find much about it. 尽管我只是翻阅了他们的文档来寻找此内容(我知道它是可行的,但我之前已经做过),却找不到太多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM