当前位置:才华咖 > 互联网计算机 > 设计制作 > 网页设计 > 关于jquery插件jTimer(jquery定时器)使用方法
手机版

关于jquery插件jTimer(jquery定时器)使用方法

来源:才华咖 阅读:1.36W 次

复制代码 代码如下:

关于jquery插件jTimer(jquery定时器)使用方法

(function ($) {

$nd({

timer: function (action,context,time) {

var _timer;

if ($nction(action)) {

(function () {

_timer = setInterval(function () {

if (!action(context)) {

clearInterval(_timer);

}

}, time);

})();

}

}

});

})(jQuery);

复制代码 代码如下:

#wrap

{

display: table;

margin: 0 auto;

}

#cvs

{

display: table-cell;

vertical-align: middle;

}

function drawRound(context) {

if (terclockwise) {

draw(context.x, context.y, context.r, t, t - / 50, terclockwise);

t -= / 50;

return t > 0.5 * ;

}

else {

draw(context.x, context.y, context.r, t, t + / 50, terclockwise);

t += / 50;

return t < ;

}

}

function draw(x, y, r, sAngle, eAngle, counterclockwise) {

var cvs = lementById("cvs");

ctx = ontext("2d");

keStyle = "#f00";

nPath();

(x, y, r, sAngle, eAngle, counterclockwise);

ke();

}

$(function () {

$r(drawRound, { x: 100, y: 100, r: 50, start: 1.5 * , counterclockwise: true }, 200);

$r(drawRound, { x: 100, y: 100, r: 60, start: 0, counterclockwise: false }, 200);

});

本文链接:https://www.caihuaka.com/sjzz/sjzz/j3qp0z.html

Copyright © 2024. 才华咖 All right reserved. 浙ICP备20120231号-3

文字美图素材,版权属于原作者。部分文章内容由网友提供推送时因种种原因未能与原作者联系上,若涉及版权问题,敬请原作者联系我们,立即处理。