会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 133648个问题
WEB前端全系列/第十九阶段:Vue2知识体系(旧)/Vue基础知识 27886楼
WEB前端全系列/第十九阶段:Vue2知识体系(旧)/Vue基础知识 27887楼
JAVA 全系列/第二阶段:JAVA 基础深化和提高/手写服务器项目(旧) 27888楼

求老师帮忙看下我的代码哪里出错了,效果一直出不来。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>canvas小球动画</title>
    <style>
        canvas{
            border:1px solid;
        }
    </style>
</head>
<body>
    <canvas width="400" height="300">你的浏览器不支持canvas标签</canvas>
    <script>
        var mycanvas=document.querySelector('canvas');
        var ctx=mycanvas.getContext('2d');
        var x=50;
        var y=50;
        var speed=-1;
        var speedY=2;
        //绘制一个小球
        var timer=setInterval(function(){
            ctx.clearRect(0,0,mycanvas.width,mycanvas.height);
            speed+=speed;
            if(x<=20){
                speed=Math.abs(speed);
            }else if(x>=380){
                speed=-speed;
            }
            speedY+=speedY;
            if(y>=280){
                speedY=-speedY;
            }else if(y<=20){
                speedY=-speedY;
            }
            ctx.beginPath();
            ctx.arc(x,y,20,0,2*Math.PI);
            // ctx.stroke();
            ctx.fillStyle='skyblue';
            ctx.fill();
            ctx.closePath();
        },60);
    </script>
</body>
</html>


WEB前端全系列/第九阶段:HTML5新特性模块/(旧)H5新特性 27890楼
JAVA 全系列/第十八阶段:亿级高并发电商项目_架构/编码(旧)/电商:基于FastDFS+Nginx+Kinkeditor实现商品新增 27891楼

蓝莓派_project.zip

老师后台数据穿不来 前台也有问题


WEB前端全系列/第六阶段:音乐社区高级项目模块/移动端:基于jQuery使用Ajax和BootStrap 27893楼
Python 全系列/第三阶段:Python 网络与并发编程/网络通信 27894楼

1、一直有这个警告

jquery.min.js:4 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.


2、在点击-选择类目中,点击到文件 电子书,就有这个问题,但能实现新增商品

jquery.min.js:4 GET http://localhost/item/param/query/itemcatid/3 404


错误.png

JAVA 全系列/第十八阶段:亿级高并发电商项目_架构/编码(旧)/电商:基于FastDFS+Nginx+Kinkeditor实现商品新增 27895楼
JAVA 全系列/第二阶段:JAVA 基础深化和提高/手写服务器项目(旧) 27897楼
Python 全系列/第二阶段:Python 深入与提高/游戏开发-坦克大战 27898楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637