From f0ac139491e5ba482a4e5977f5cc12a1eff89801 Mon Sep 17 00:00:00 2001 From: HongWeipeng Date: Thu, 15 Nov 2018 16:57:26 +0800 Subject: [PATCH] fix canvas not found --- js/home.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/js/home.js b/js/home.js index f2c14c2..e177921 100644 --- a/js/home.js +++ b/js/home.js @@ -79,14 +79,16 @@ var closeEnable = false; $(document).ready(function () { fssilde(); - TagCanvas.Start('mycanvas', '', { - textColour : '#000', - outlineColour: '#16a085', - outlineThickness : 1, - maxSpeed : 0.03, - depth : 0.75, - wheelZoom : false - }); + if(document.getElementById("mycanvas")) { + TagCanvas.Start('mycanvas', '', { + textColour: '#000', + outlineColour: '#16a085', + outlineThickness: 1, + maxSpeed: 0.03, + depth: 0.75, + wheelZoom: false + }); + } //边栏固定 var $sidebar = $("#fixed"),