大橙子网站建设,新征程启航

为企业提供网站建设、域名注册、服务器等服务

如何使用html5制作loading图

小编给大家分享一下如何使用html5制作loading图,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

网站建设哪家好,找创新互联建站!专注于网页设计、网站建设、微信开发、重庆小程序开发、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了乌兰免费建站欢迎大家使用!

代码如下:

<!DOCTYPE html>

</ title></p><p></ head></p><p><body></p><p><canvas id =“ canvas”> </ canvas> </ p> <p> <script></p><p>var Loading =功能(画布,选项){</p><p>this.canvas = document.getElementById(canvas);</p><p>this.options =选项;</p><p>}; </ p> <p> Loading.prototype = {</p><p>构造函数:正在加载,</p><p>显示:function(){</p><p>var canvas = this.canvas,</p><p>begin = this.options.begin,</p><p>old = this.options.old,</p><p>lineWidth = this .options.lineWidth,</p><p>canvasCenter = {x:canvas.width / 2,y:canvas.height / 2},</p><p>ctx = canvas.getContext(“ 2d”),</p><p>color = this.options.color,</p><p>num = this.options.num,</p><p>angle = 0 ,</p><p>lineCap = this.options.lineCap,</p><p>CONST_PI = Math.PI *(360 / num)/ 180;</p><p>window.timer = setInterval(function(){</p><p>ctx.clearRect(0,0,canvas.width,canvas.height);</p><p>for(var i = 0; i <num; i + = 1){</p><p>ctx.beginPath();</p><p>ctx.strokeStyle = color [num-1-i];</p><p>ctx.lineWidth = lineWidth;</p><p>ctx.lineCap = lineCap;</p><p>ctx.moveTo(canvasCenter.x + Math.cos(CONST_PI * i +角度)*开始,canvasCenter.y + Math.sin(CONST_PI * i +角度)*开始);</p><p>ctx.lineTo(canvasCenter.x + Math.cos(CONST_PI * i + angle)*旧,canvasCenter.y + Math.sin(CONST_PI * i + angle)* old);</p><p>ctx.stroke();</p><p>ctx.closePath();</p><p>}</p><p>angle + = CONST_PI;</p><p>console.log(angle)</p><p>},50);</p><p>},</p><p>hide:function(){</p><p>clearInterval(window.timer);</p><p>}</p><p>}; </ p> <p>(函数(){</p><p>var options = {</p><p>num:8,</p><p>begin:20,</p><p>old:40,</p><p>lineWidth:10,</p><p>lineCap:“ round”,</p><p>颜色:[“ rgb(0,0,0)”,“ rgb(20,20,20 )” ,“ rgb(40、40、40)”,“ rgb(60、60、60)”,“ rgb(80、80、80)”,“ rgb(100、100、100)”,“ rgb(120, 120,120)“,” rgb(140,140,140)“]</p><p>};</p><p>var loading = new Loading(“ canvas”,options);</p><p>loading.show();</p><p>}());</p><p></ script></p><p></ body></p><p></ html></p><p>以上是“如何使用html5制作loading图”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联行业资讯频道!</p> <br> 新闻标题:如何使用html5制作loading图 <br> 本文链接:<a href="http://dzwzjz.com/article/jddedj.html">http://dzwzjz.com/article/jddedj.html</a> </div> </div> <div class="othernews"> <h3>其他资讯</h3> <div class="othernews_list"> <ul> <li> <a href="/article/dgdsgde.html">android的通讯机制 android通信协议</a> </li><li> <a href="/article/dgdsgco.html">简单的html5 简单的HTML5动态背景图</a> </li><li> <a href="/article/dgdsgoo.html">关于jquery网站发布的信息</a> </li><li> <a href="/article/dgdsgoh.html">html5各种标签 html5的标签</a> </li><li> <a href="/article/dgdsipg.html">jquery用哪个 jquery哪个版本</a> </li> </ul> </div> </div> </div> </div> <div class="footer"> <div class="footer_content"> <div class="footer_content_top clear"> <div class="content_top_share fl"> <div><img src="/Public/Home/img/logo.png"></div> <div class="top_share_content"> <dd>分享至:</dd> <dt class="bdsharebuttonbox clear" id="share"> <a href="#" class="bds_tsina iconfont fl" data-cmd="tsina" title="分享到新浪微博"></a> <a href="#" class="bds_sqq iconfont fl" data-cmd="sqq" title="分享到QQ好友"></a> <a href="#" class="bds_weixin iconfont fl" data-cmd="weixin" title="分享到微信"></a> <a href="#" class="bds_weixin iconfont fl" data-cmd="tieba" title="分享到贴吧"></a> </dt> <script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script> </div> </div> <div class="content_top_left fl clear"> <div class="top_left_list fl"> <dd><a href="/about/">关于我们</a></dd> <dt> <a href="/about/#gsjj">公司简介</a> <a href="/about/#fzlc">发展历程</a> </dt> </div> <div class="top_left_list fl"> <dd><a href="/service/">服务项目</a></dd> <dt> <a href="/service/">高端网站建设</a> <a href="/miniprogram/">小程序开发</a> <a href="/service/app.html">APP开发</a> <a href="/service/yingxiao.html">网络营销</a> </dt> </div> <div class="top_left_list fl"> <dd><a href="/jianzhan/">建站知识</a></dd> <dt> <a href="/jianzhan/">行业新闻</a> <a href="/jianzhan/">建站学堂</a> <a href="/jianzhan/">常见问题</a> </dt> </div> <div class="top_left_list fl"> <dd><a href="/contact/">联系我们</a></dd> <dt> <a href="/contact/#lxwm">公司地址</a> <a href="/contact/#rczp">人才招聘</a> </dt> </div> </div> <div class="content_top_right addressR fr"> <div class="top_right_title addressf_title"> <a href="javascript:;" class="on">成都</a> <a href="javascript:;">达州</a> </div> <div class="top_right_content addressf"> <div class="right_content_li on"> <div class="right_content_list clear"> <dd class="fl iconfont"></dd> <dt class="fl">电话:028-86922220</dt> </div> <div class="right_content_list clear"> <dd class="fl iconfont"></dd> <dt class="fl">地址:成都市太升南路288号锦天国际A幢1002号</dt> </div> </div> <div class="right_content_li"> <div class="right_content_list clear"> <dd class="fl iconfont"></dd> <dt class="fl">电话:028-86922220</dt> </div> <div class="right_content_list clear"> <dd class="fl iconfont"></dd> <dt class="fl">地址:达州市南岸区弹子石腾龙大道58号2栋21-6</dt> </div> </div> </div> </div> </div> <div class="link"> 友情链接: <a href="http://www.wzyarui.cn/" title="门店招牌设计安装" target="_blank">门店招牌设计安装</a>   <a href="https://www.cdxwcx.com/jifang/wenjiang.html" title="温江电信机房" target="_blank">温江电信机房</a>   <a href="https://www.cdxwcx.com/400/" title="成都400电话办理" target="_blank">成都400电话办理</a>   <a href="http://www.cxjianzhan.com/mobile/" title="wap网站建设" target="_blank">wap网站建设</a>   <a href="http://chengdu.cdcxhl.cn/shop/ " title="成都商城开发" target="_blank">成都商城开发</a>   <a href="http://www.cdkjz.cn/wangzhan/" title="网站seo优化" target="_blank">网站seo优化</a>   <a href="http://www.cdhuace.com/faguangzi/wbfgz.html" title="led无边发光字" target="_blank">led无边发光字</a>   <a href="http://www.kswsj.cn/" title="网站营销推广" target="_blank">网站营销推广</a>   <a href="http://www.cdxwcx.cn/tuoguan/zigong.html" title="自贡主机托管" target="_blank">自贡主机托管</a>   <a href="http://www.shjinzhi.cn/" title="兴宏源活动板房" target="_blank">兴宏源活动板房</a>    </div> </div> <div class="footer_content_copyright clear">版权所有:青羊区大橙子信息咨询工作室 <a href="http://beian.miit.gov.cn/" rel="nofollow" target="_blank">蜀ICP备2022028542号-14</a> </div> </div> <!--浮窗--> <div class="FloatingWindow clear"> <a href="tencent://message/?uin=1683211881&Site=&Menu=yes" class="FloatingWindow_list fr"> <div class="FloatingWindow_list_title"> <dd class="iconfont"></dd> <dt><span>在线</span>咨询</dt> </div> </a> <a href="javascript:;" class="FloatingWindow_list fr"> <div class="FloatingWindow_list_title"> <dd class="iconfont"></dd> <dt>服务热线</dt> </div> <div class="FloatingWindow_list_down fadeInRight animated">服务热线:028-86922220</div> </a> <a href="javascript:;" class="FloatingWindow_list fr STop"> <div class="FloatingWindow_list_title"> <dd class="iconfont"></dd> <dt>TOP</dt> </div> </a> </div> <script src="/Public/Home/js/jquery-1.8.3.min.js"></script> <script src="/Public/Home/js/comm.js"></script> <script src="/Public/Home/js/wow.js"></script> <script src="/Public/Home/js/common.js"></script> </body> </html> <script> $(".cont img").each(function(){ var src = $(this).attr("src"); //获取图片地址 var str=new RegExp("http"); var result=str.test(src); if(result==false){ var url = "https://www.cdcxhl.com"+src; //绝对路径 $(this).attr("src",url); } }); window.onload=function(){ document.oncontextmenu=function(){ return false; } } </script>