jQuery(document).ready(function () { jQuery('[data-particlejs-id]').each(function (index) { var shape = jQuery(this).data('particlejs-shape'); var count = jQuery(this).data('particlejs-count'); var size = jQuery(this).data('particlejs-size'); var color = jQuery(this).data('particlejs-color'); jQuery(this).parent().parent().parent().css("position", "absolute").css("z-index", "0").css("left", "0").css("top", "0").css("width", "100%").css("height", "100%"); for (x = 0; x < count; x++) { var randomnumber = Math.floor(Math.random() * (size - 0 + 1)) + 0; if(shape == 'triangle') { jQuery(this).append('
'); } else if(shape == 'circle') { jQuery(this).append(''); } else if(shape == 'moon') { jQuery(this).append(''); } else if(shape == 'pacman') { jQuery(this).append(''); } else { jQuery(this).append(''); } } }); });