javascript - particles.js not compatible for <!DOCTYPE html> tag? -
i use particles.js library in project index page, when resize browser window, particles canvas not strech fit window height, , leave large blank area on bottom of window (shown image below)
but if remove <!doctype html> tag page, plugin works on window resizing (100% area filled).
why happen ? particles.js not compatible <!doctype html> tag ?
<!doctype html> <html> .... <script src="js/particles.js-2.0.0/particles.min.js"></script> <style> #div_particles { position: absolute; top: 0; width: 100%; background-color: #fff; } </style> <script> $(function() { particlesjs.load("div_particles", "js/particles.js-2.0.0/nasa.json.txt", function() {}); }); </script> <div id="div_particles"></div> .... </html>

Comments
Post a Comment