غالبًا ما نشارك في العديد من الأنشطة الترويجية للتجارة الإلكترونية ، مثل الشراء إلى مبلغ معين لإجراء أنشطة اليانصيب ، مثل WeChat Lottery و Taobao Lottery و Thunder Moxip Complication BAO Disk Lottery ، وما إلى ذلك. سأشارككم اليوم كيفية استخدام Canvas HTML5 لإنشاء وظيفة يسعر القرص. كالعادة ، دعونا نلقي نظرة على العروض أولاً:
دعونا نلقي نظرة على العديد من واجهات برمجة التطبيقات الرئيسية في القماش:
جميع رموز المصدر هي كما يلي:
<! doctype html> <html lang = "zh-cn"> <head> <meta charset = "utf-8"> <title> html5 canvas discist discore demo demo </title> <meta name = "viewport" content = "width = width width ، inial-scale = 1 ، 0px ؛ font-size: 16px ؛ font-family: "Microsoft yahei" ؛}. . 20 ؛}#xttblog {-o-transform: transform 6s ؛ -Ms-transform: transform 6s ؛ -moz-transform: transform 6s ؛ -webkit-transform: Transform 6s ؛ Transition: Transform 6s ؛ -o transform-Origin: 50 ٪ 50 ٪ ؛-MS-Transform-Origin: 50 ٪ 50 ٪ ؛-Moz-Transform-Origin: 50 ٪ 50 ٪ ؛-Webkit-transform-origin: 50 ٪ 50 ٪ ؛ Transform-Origin: 50 ٪ 50 ٪ ؛} 60px ؛ اليسار: 120 بكسل ؛ أعلى: 120 بكسل ؛ حدود راديوس: 100 ٪ ؛ الموضع: المطلق ؛ المؤشر: المؤشر ؛ الحدود: لا شيء ؛ الخلفية: الشفافة ؛ المخطط: لا شيء ؛ z-index: 40 ؛} </style> <script type = "text/javaScript" src = "http://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"> </script> <script> $ (document) .Ready (function () {// angle angle angles ؛ تهيئة VAR COLOR = ["#626262" ، "#787878" ، "RGBA (0،0،0،5)" = ["لا تزال تعمل بجد" ، "يوان" ، "يوان" ، "عملات ذهبية" ، "يوان" ، "عملات ذهبية"] canvasrun () ؛ لا يمكن النقر فوق زر "بدء السحب" للقرص الدوار $ (#tupbtn). } {تنبيه (عزيزي ، تم استخدام عدد السحب! ") ؛ $ (#xttblog) $ (#xttblog) info [0] + infrom [0] 2160 * rotnum + 1935 ؛ آخر (num == 5) info [1] canvas02 = document.getElementByed ('xttblog02') ؛ CreateCircle () ؛ startlange+pi (1/4) ؛ CTX.Stroke () ctx.beginpath () ؛ yahei "؛ ctx.filltext (info1 [i] ،-30 ، -95،60) ؛ ctx.closepath () ؛ CTX1.LINETO (110،62) ؛ CTX3.FILLSTYLE = 5] ctx3 اللون [2] ؛ المتصفح لا يدعمه. </sanvas> <canvas id = "xttblog01"> آسف! المتصفح لا يدعمه. </sanvas> <canvas id = "xttblog03"> آسف! المتصفح لا يدعمه. </sanvas> <canvas id = "xttblog02"> آسف! المتصفح لا يدعمه. </sanvas> <button id = "tupbtn"> </utton> </viv> <!-قم بتغيير النافذة المنبثقة الافتراضية للنظام-> <script type = "text/javaScript"> window.alert = function (str) {var shield = document.createlement ("div") ؛ Shield.id = "Shield" ؛ shield.style.position = "absolute" ؛ Shield.Style.Left = "50 ٪" ؛ shield.style.top = "50 ٪" ؛ shield.style.width = "280px" ؛ shield.style.height = "150px" ؛ shield.style.marginleft = "-140px" ؛ shield.style.margintop = "-110px" ؛ shield.style.zindex = "25" ؛ var alertfram = document.createElement ("div") ؛ ALERTFRAM.ID = "Alertfram" ؛ ALERTFRAM.STYLE.POSSION = "Absolute" ؛ alertfram.style.width = "280px" ؛ alertfram.style.height = "150px" ؛ ALERTFRAM.STYLE.LEFT = "50 ٪" ؛ ALERTFRAM.STYLE.TOP = "50 ٪" ؛ alertfram.style.marginleft = "-140px" ؛ ALERTFRAM.STYLE.MARGINTOP = "-110px" ؛ alertfram.style.textalign = "center" ؛ alertfram.style.lineheight = "150px" ؛ alertfram.style.zindex = "300" ؛ strhtml = "<ul style =/" list-style: none ؛ margin: 0px ؛ padding: 0px ؛ width: 100 ٪/">/n" ؛ strhtml += "<li style =/" الخلفية: #626262 ؛ محاذاة النص: اليسار ؛ الحشو اليساري: 20px ؛ الحجم font: 14px ؛ font-weight: Bold ؛ الارتفاع: 25px ؛ خط الارتفاع: 25px ؛ الحدود: 1 بكسل Solid #f9cade ؛ اللون: أبيض/". strhtml+= "<li style =/" background: #787878 ؛ text-align: center ؛ font-size: 12px ؛ height: 95px ؛ line-height: 95px ؛ border-left: 1px Solid #f9cade ؛ strhtml += "<li style =/" background:#626262 ؛ text-align: center ؛ font-weight: bold ؛ leight: 30px ؛ line-height: 25px ؛ الحدود: 1px solid #f9cade ؛/"> <type type =/" button/"value =/" ok/"onClick =/" dook ()/"style =/" width: 80px ؛ الارتفاع: 20px ؛ الخلفية: #626262 ؛ اللون: اللون الأبيض ؛ الحدود: 4px/"/> </li>/n" ؛ strhtml += "</ul>/n" ؛ alertfram.innerhtml = strhtml ؛ document.body.appendChild (Alertfram) ؛ document.body.appendchild (Shield) ؛ this.dook = function () {alertfram.style.display = "none" ؛ shield.style.display = "none" ؛ } alertfram.focus () ؛ document.body.onselectStart = function () {return false ؛} ؛} </script> </body> </html>ما سبق هو كل شيء عن هذا المقال ، آمل أن يكون مفيدًا لتعلم الجميع.
العنوان الأصلي: http://www.xttblog.com/؟p=399