如何使spritespin自动调整大小适合窗口?

时间:2017-09-07 13:56:08

标签: html

我使用spritespin时遇到问题。画布无法调整大小适合窗口,我已经尝试了CSS相同的工作图像适合窗口,但它没有工作。这是spritespin基本用法的示例。 this is the example of spritespin basic usage

<script type="text/javascript">
$(function(){
$('.spritespin').spritespin({
  // generate an array of image urls.
  // this is a helper function that takes a {frame} placeholder
  source: SpriteSpin.sourceArray('/images/rad_zoom_{frame}.jpg', {
    // this ramge of numbers is interpolated into the {frame} placeholder
    frame: [1,34],
    // the frame placeholder will be padded with leading '0' up to the number of 'digits'
    digits: 3
  }),
  // Specify the display width and height of the frame.
  // Optionally the size of the container can be defined with CSS.
  width: 480,
  height: 327,
  // Sense controls the direction and speed of the animation for mouse/touch interactions.
  // Here a negative value is chosen to invert the rotation, so the animation 'follows' the drag direction.
  // Values towards 0 will slow the animation down.
  sense: -1
});
});
</script>

如何让spritespin自动调整大小适合窗口?

<div class="spritespin spritespin-instance with-canvas" unselectable="on" ><div class="spritespin-stage" ></div><canvas class="spritespin-canvas"></canvas></div>

1 个答案:

答案 0 :(得分:0)

在spritespin函数内调用set&#34; responsive:true&#34;。