色综合电影网,欧美男人天堂,成人直播视频,白浆视频在线观看

js怎么寫隨機產(chǎn)生的驗證碼(js制作四位隨機驗證碼)

本文主要介紹js如何寫隨機生成的驗證碼(js做四個隨機驗證碼)?,下面一起看看js如何寫隨機生成的驗證碼(js做四個隨機驗證碼)?相關(guān)資訊。
需要先輸入html2canvas.js。
本來是用來生成海報的,后來改成了生成驗證碼。
僅供參考
!文件類型htmlhtml頭元字符集= utf-8 腳本src = js/public.js/script link rel = 樣式表href = css/style.css/script type = 文本/javascript src = js/html 2 can vas . js /腳本樣式。海寶{ position: absolute;top : 0;left : 0;width : 4 rem;z-index: 0;width: 2.3雷姆;h: 1雷姆;lin: 1雷姆;t:中心;} .海寶span{font-siz: . 6 r:大膽;} .imag: 2雷姆;}/style/head body div id = app class = app v形斗篷圖像與圖像生成的圖形/p div class = myimage @ click = 海報 id = myimage v-html = 圖像與圖像/div!-驗證碼后臺-div id = 主集裝箱及配件ref = 集裝箱與運輸class = 海寶 : styl:·考爾伯格} span : styl:項目。顏色和;;fontstyle :item . font }] v-for = (項目,索引)在列表和;: key = 指數(shù)和指數(shù){ { item . text } }/span/div/div/body script var vm = n: ;# app ,data: { list:[{t: ;1 }、{t: ; }、{t: ;1 }、{t: ;= }、{t: ;? },],colorbg: ; 、r: ; ,image: ; ,},m: { poster{ this . image = ; ;this . colorbg = this . color fun;this.list.foreach((item,index)= { item[ ;顏色和顏色。;]= this . color fun;項目[ ;字體和字體。;]= this . font fun;ind: ; ;ind: ; ;ind: ; ;})這個。mak:函數(shù)(id){//生成驗證碼var _ this = thisdocument . body . style . overflow = ;隱藏 ;這個。$ refs . container . style . pointer events = ;汽車與娛樂。;;這個。$ next tick(function{//if if(this . isend)在生成的同時沒有生成。{返回;} this.isend = true_ this . make code(id);//生成驗證碼});},makecode(id) {//生成驗證碼this。$ refs . container . style . dis block = ;街區(qū) ;var _ this = thisvar share content = document . getelementbyid(id);//對于要繪制部分的(原生)dom對象,注意不要對容器的寬度使用百分比,使用固定寬度,避免縮放問題;var width = sharecontentoffsetwidth//get(native)dom width var height = share content。偏高;//獲取(本機)dom高度變量offsettop = sharecontent。offsettop//元素從頂部var canvas = document . createelement( ;帆布 );//創(chuàng)建一個畫布對象varcontext = canvas。get context( ;2d );var scale by = 2;canvas.width = width * scaleby//因為這里畫的dom是定寬居中的,所以沒有偏移畫布。height =(height offsettop)* scale by;//注意身高問題。因為頂部有距離,所以要加上頂部的距離來解決圖像高度偏移的問題。varopts = {scal: scale by,//添加比例參數(shù)canvas:畫布,//自定義畫布logging: true,//log switch,發(fā)布時記得改成假width:寬度,//dom原寬度h:高度,//dom原高度backgroundcolor: 透明 ,};html2canvas(document . query selector( ;# id)、opts)。然后(function(canvas){ document . body . appendchild(canvas);設(shè)oimg = new image;oimg . src = canvas . toda taurl( 圖片/png );//導(dǎo)出圖像vm.image = img src = amp oimg.src / ;vm.isend = falsevm.shadowhb = true});this.result = eval(this.list[0])。文本this.list[1]。文本this.list[2]。正文);},color fun{//random color return ` rgb($ { math . round(math . random* 255)},$ { math . round(math . random* 255)},$ {math.round (math.random)}。},font fun{//random font style return this . random num(0,1) == 0?: ;斜體和。;},random num (min,max){//隨機數(shù)范圍var rang:這個。randomnum (0,9)},operation fun{//隨機運算符返回this.randomnum(0,1) == 0?: ;- ;}},掛載{//生成隨機驗證碼this . poster;},已創(chuàng)建{ } });/腳本
標(biāo)簽:
驗證碼寬度
了解更多js如何寫隨機生成的驗證碼(js做四個隨機驗證碼)?相關(guān)內(nèi)容請關(guān)注本站點。

paper white3和4(paperwhite2和3的區(qū)別4)
固態(tài)硬盤怎么分盤,固態(tài)硬盤怎樣進(jìn)行分區(qū) 固態(tài)硬盤分區(qū)詳細(xì)圖文教程
長城ssd固態(tài)硬盤怎么樣,固態(tài)硬盤怎么樣好不好
強制格式化硬盤命令win10,強制格式化命令
固態(tài)在哪個盤,懂電腦的大佬幫忙看看 固態(tài)在哪個盤里
js怎么寫隨機產(chǎn)生的驗證碼(js制作四位隨機驗證碼)
華為 鴻蒙 電腦(華為鴻蒙系統(tǒng)電腦版安裝教程)
電腦游戲手柄怎么用視頻教程(電腦游戲手柄怎么用)
投影幕布哪種材質(zhì)的更清晰(投影儀幕布哪種材質(zhì)好)
mac如何裝雙系統(tǒng)win10(mac怎么安裝win雙系統(tǒng))
電腦游戲主機哪個品牌比較好(電腦游戲主機排行榜前十名)
sonyz1速度緩慢怎么辦,速度太慢怎么辦
搜狗大五碼怎么弄(搜狗輸入法切換大五碼快捷鍵)
怎么在電腦桌面上顯示微信圖標(biāo)(電腦上微信圖標(biāo)變成了文件)
筆記本機械硬盤品牌
pe系統(tǒng)遷移到固態(tài)硬盤會怎么樣,加裝固態(tài)硬盤后如何遷移系統(tǒng)
三星筆記本硬盤在哪,三星r467筆記本硬盤接口
怎么查找微信黑名單和被我刪除的人信息(怎么查找微信黑名單和被我刪除的人聊天記錄)
今日頭條怎么快速過新手期(今日頭條怎么才能轉(zhuǎn)正)
不開燈看電腦屏幕(玩電腦不開燈)
主站蜘蛛池模板: 扶绥县| 闸北区| 广灵县| 大理市| 呼图壁县| 仪征市| 成安县| 宁城县| 兴海县| 浦北县| 全南县| 营山县| 留坝县| 吉首市| 济阳县| 大足县| 吉隆县| 铜陵市| 友谊县| 克什克腾旗| 铜山县| 陕西省| 南平市| SHOW| 广州市| 乌拉特前旗| 刚察县| 佛学| 九龙县| 张家界市| 曲靖市| 连云港市| 鹤山市| 句容市| 隆回县| 梁平县| 新邵县| 曲水县| 苍溪县| 靖宇县| 新巴尔虎左旗|