我正在尝试使用与网站http://www.turnjs.com/samples/magazine/上的示例具有相同功能的 turn.js 制作翻书
在查看如何实现这一点时,我遇到了这些页面
http://www.turnjs.com/docs/Method:_zoom
http://turnjs.com/docs/How_to_add_zoom_to_turn.js
但是在按照页面上的这些说明进行操作后,我的活页簿的工作方式与示例书完全不同。
我尝试使用提供的示例并将其分解为多个部分以使我的工作,但我还没有更接近解决这个问题,并且示例包含一堆其他脚本,我不确定它们是否需要缩放或者是用于其他事情。
不确定我是否遗漏了一些非常简单的东西,或者我的代码是否真的关闭但我的 html 看起来像这样。
现在,当我点击缩放按钮时,我得到的只是这本书放大了 150%
想知道是否有人可以告诉我我缺少什么来获得变焦?
<div class="row">
<div id="zoom-viewport">
<div id="flipbook">
// wordpress loop
<div class="page">
// page contents
</div>
// end loop
</div>
</div>
</div>
和 jQuery
//----------------------------
// Initialize
var _width = $('#flipbook-wrap').width(),
_height = Math.round(70.909090909/100*_width),
_winWidth = $window.width(),
_winHeight = $window.height();
$("#flipbook").turn({
width: _width,
height: _height,
autoCenter: true
});
//----------------------------
// Zoom in button
$('.fullscreen').click(function(e){
e.preventDefault();
$("#flipbook").turn("zoom", 1.5);
});