(编辑:jimmy 日期: 2024/11/16 浏览:2)
本文实例为大家分享了javascript实现画板功能的具体代码,供大家参考,具体内容如下
画板功能的实现
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> *{ margin: 0; padding: 0; list-style: none; } body{ background:url(11.jpg) 0 0 no-repeat; } .wrapper{ margin: 10px; } .wrapper canvas{ border: 1px solid blue; border-radius:25px; box-shadow: 10px 10px 5px brown; margin-bottom: 16px; background-color: #fff; } .wrapper .btn-list{ width: 1000px; text-align: center; } .wrapper .btn-list li{ display: inline-block; margin-left: 40px; } .wrapper .btn-list li input{ background-color: darkgreen; color: blanchedalmond border: none; padding: 6px 13px; cursor: pointer; border-radius:25px; font-size: 18px; display: block; transition-duration: 0.2s; } .wrapper .btn-list li input:hover{ border: 1px solid chocolate; box-shadow: 0 12px 15px 0 rgba(0,0,0,0.5); } </style> </head> <body> <!-- div.wrapper>canvas+ul.btn-list>li*5>input --> <div class="wrapper"> <canvas class="cavs" width="1000" height="500"></canvas> <ul class="btn-list"> <li><input type="color" id="colorBoard" value="colorBoard"></li> <li><input type="button" id="cleanBoard" value="清屏"></li> <li><input type="button" id="eraser" value="橡皮"></li> <li><input type="button" id="rescind" value="撤销"></li> <li><input type="range" id="lineRuler" value="线条" min="1" max="30"></li> </ul> </div> </body> <script src="/UploadFiles/2021-04-02/jquery-3.4.1.min.js">以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。