particles js 使用

<div id="particles-js" style="left: 0; right: 0; position: fixed;z-index: -1"></div>
    <script src="//cdn.bootcss.com/particles.js/1.0.2/particles.min.js"></script>
particlesJS('particles-js', {
            particles: {
                color: '#ccc',
                shape: 'circle', // "circle", "edge" or "triangle"
                opacity: 3,
                size: 5,
                size_random: true,
                nb: 150,
                line_linked: {
                    enable_auto: true,
                    distance: 200,
                    color: '#ccc',
                    opacity: 1,
                    width: 1,
                    condensed_mode: {
                        enable: false,
                        rotateX: 600,
                        rotateY: 600
                    }
                },
                anim: {
                    enable: true,
                    speed: 1
                }
            },
            interactivity: {
                enable: false,
                mouse: {
                    distance: 250
                },
                detect_on: 'canvas', // "canvas" or "window"
                mode: 'grab',
                line_linked: {
                    opacity: .5
                }
            },
            /* Retina Display Support */
            retina_detect: true
        });

 

posted @ 2016-10-21 11:07  游子善心  阅读(11)  评论(0编辑  收藏  举报  来源