1、在页面中设置一个div,引用所有css以及js文件;
1 2 3 4 5 6 7 8 9 | < link rel = "stylesheet" href = "css/base.css" > < link rel = "stylesheet" href = "css/canvas-board.css" > < link rel = "stylesheet" href = "css/clip.css" > < link rel = "stylesheet" href = "css/image-clip.css" > < script src = "js/canvasBoard.js" ></ script > < script src = "js/image-clip.js" ></ script > < script src = "js/fileinput.js" ></ script > < script src = "js/exif.js" ></ script > |
2、设置点击事件并通过
1 | var cav = new CanvasBoard( "canvas-container" , "" );cav.init(); |
调用插件
3、设置一个img标签放生成的图片
1 | < img src = "" alt = "" id = "imgBox" width = "1024" height = "auto" /> |
4、文件下载后若要调试,可将js文件中两段代码注释掉即可。(如下)
1 2 3 4 5 6 7 8 9 10 11 | $( "*" ).keydown( function (e) { //判断按键 e = window.event || e || e.which; if (e.keyCode == 123) { e.keyCode = 0; return false ; } }); $(document).bind( "contextmenu" , function (e) { return false ; }); |
特别申明:
本站所有资源都是由网友投稿发布,或转载各大下载站,请自行检测软件的完整性!
本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!
如有侵权请联系我们删除下架,联系方式:lei1294551502@163.com