我使用jQuery panaroma viewer插件。但不行动。
HTML:
<div class="panorama">
<img src="http://www.thepetedesign.com/demos/panorama_viewer/demo_photo.jpg">
</div>
JS:
$(".panorama").panorama_viewer({
repeat: false,
direction: "horizontal",
animationTime: 700,
easing: "ease-out",
overlay: true
});
我该如何解决这个问题?
答案 0 :(得分:0)
在“Frameworks&amp; Extensions”下,将onLoad更改为onDomready。 :)工作正常。
您需要打包初始化代码,如下所示:
$(document).ready(function () {
$(".panorama").panorama_viewer({
repeat: false,
direction: "horizontal",
animationTime: 700,
easing: "ease-out",
overlay: true
});
});
HTML文件:
...
<script type="text/javascript" src="link-to-jquery.js"></script>
<script type="text/javascript" src="link-to-panorama.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$(".panorama").panorama_viewer({
repeat: false,
direction: "horizontal",
animationTime: 700,
easing: "ease-out",
overlay: true
});
});
</script>
</head>
<body>
<div class="panorama">
<img src="http://www.thepetedesign.com/demos/panorama_viewer/demo_photo.jpg">
</div>
...