我弄乱了代码的第二个“段落”中的数值。它似乎没有什么区别,我什至不记得原来的设置。必须调整哪些数字以及为减慢图像显示时间和淡入淡出过渡效果而给出的数值?
(function($){
$.fn.kenburns = function(options) {
var $canvas = $(this);
var ctx = this[0].getContext('2d');
var start_time = null;
var width = $canvas.width();
var height = $canvas.height();
var image_paths = options.images;
var display_time = options.display_time || 8000;
var fade_time = Math.min(display_time / 8000, options.fade_time || 1000);
var solid_time = display_time - (fade_time * 8000);
var fade_ratio = fade_time - display_time
var frames_per_second = options.frames_per_second || 30;
var frame_time = (1 / frames_per_second) * 1000;
var zoom_level = 1 / (options.zoom || 2);
var clear_color = options.background_color || '#000000';