Skip to content

Commit 18358a4

Browse files
author
Jonathan Nicol
committed
Updated plugin version
1 parent 5808973 commit 18358a4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

js/jquery.particleground.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
function Plugin(element, options) {
3939
var el = element;
4040
var $el = $(element);
41+
var canvasSupport = !!document.createElement('canvas').getContext;
4142
var canvas;
4243
var ctx;
4344
var particles = [];
@@ -59,6 +60,8 @@
5960
* Init
6061
*/
6162
function init() {
63+
if (!canvasSupport) { return; }
64+
6265
//Create canvas
6366
$canvas = $('<canvas class="pg-canvas"></canvas>');
6467
$el.prepend($canvas);
@@ -105,6 +108,8 @@
105108
* Draw particles
106109
*/
107110
function draw() {
111+
if (!canvasSupport) { return; }
112+
108113
winW = $(window).width();
109114
winH = $(window).height();
110115

js/jquery.particleground.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)