最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jQuery實現(xiàn)炫酷的鼠標(biāo)軌跡特效

 更新時間:2015年02月01日 10:39:57   投稿:hebedich  
本文給大家分享的是一段jQuery實現(xiàn)炫酷的鼠標(biāo)軌跡的特效代碼,希望小伙伴們能夠喜歡。

代碼:

復(fù)制代碼 代碼如下:

<!DOCTYPE html>
<html xmlns=" <head>
<title>jQuery實現(xiàn)炫酷的鼠標(biāo)軌跡特效</title><base target="_blank" />
<script type="text/javascript"> window.onload = function () {
C = Math.cos; S = Math.sin; U = 0; w = window; j = document; d = j.getElementById("kele"+"yi_com"); c = d.getContext("2d"); W = d.width = w.innerWidth; H = d.height = w.innerHeight; c.fillRect(0, 0, W, H); c.globalCompositeOperation = "lighter"; c.lineWidth = 0.2; c.lineCap = "round"; var bool = 0, t = 0; d.onmousemove = function (e) {
if (window.T) {
if (D == 9) { D = Math.random() * 15; f(1); }
clearTimeout(T);
}
X = e.pageX; Y = e.pageY; a = 0; b = 0; A = X, B = Y; R = (e.pageX / W * 999 >> 0) / 999; r = (e.pageY / H * 999 >> 0) / 999; U = e.pageX / H * 360 >> 0; D = 9; g = 360 * Math.PI / 180; T = setInterval(f = function (e) {
c.save(); c.globalCompositeOperation = "source-over"; if (e != 1) { c.fillStyle = "rgba(0,0,0,0.02)"; c.fillRect(0, 0, W, H); }
c.restore(); i = 25; while (i--) {
c.beginPath(); if (D > 450 || bool) {
if (!bool) { bool = 1; }
if (D < 0.1) { bool = 0; }
t -= g; D -= 0.1;
}
if (!bool) { t += g; D += 0.1; }
q = (R / r - 1) * t; x = (R - r) * C(t) + D * C(q) + (A + (X - A) * (i / 25)) + (r - R); y = (R - r) * S(t) - D * S(q) + (B + (Y - B) * (i / 25)); if (a) { c.moveTo(a, b); c.lineTo(x, y) }
c.strokeStyle = "hsla(" + (U % 360) + ",100%,50%,0.75)"; c.stroke(); a = x; b = y;
}
U -= 0.5; A = X; B = Y;
}, 16);
}
j.onkeydown = function (e) { a = b = 0; R += 0.05 }
d.onmousemove({ pageX: 300, pageY: 290 })
}</script>
<style>body{margin:0;overflow:hidden}div{padding:1px 5px;background:#333;position:absolute;z-index:2;color:#555;font-family:arial}a{color:#ccf}a:hover{color:red}</style>
</head>
<body>
<div id="text"></div>
<canvas id="keleyi_com"></canvas>
</body>
</html>

以上就是本文的內(nèi)容了,希望小伙伴們喜歡此特效,快過年了,給自己的個人主頁增添些色彩吧。

相關(guān)文章

最新評論

英超| 宜君县| 嵊州市| 称多县| 锦州市| 潍坊市| 平江县| 洛宁县| 云浮市| 新郑市| 上杭县| 古田县| 阳城县| 嘉峪关市| 霍州市| 图木舒克市| 云阳县| 德阳市| 博爱县| 辽阳县| 萨迦县| 余江县| 瑞安市| 滨海县| 保亭| 上思县| 天长市| 文水县| 稻城县| 克山县| 敦化市| 黄平县| 浦江县| 宝兴县| 平山县| 徐闻县| 卢龙县| 建德市| 年辖:市辖区| 中方县| 博乐市|