鼠标悬浮跟随效果
代码语言:html
所属分类:悬停
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
body {
background-color: #a5e2ff;
margin: 0;
overflow: hidden;
}
canvas {
touch-action: none;
}
</style>
</head>
<body translate="no">
<canvas id="c" width="500px" height="500px"></canvas>
<script type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/TweenMax.min.js"></script>
<script>
// Define an object that will be used to draw plus signs
var Plus = function () {
this.x = 0;
this.y = 0;
this.top = 0;
this.left = 0;
this.height = 0;
this.width = 0;
this.scale = 1;
};
//Add draw method to the object
Plus.prototype.draw = function (ctx, x, y) {
ctx.save();
ct.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0