loktar00 / JQuery-Snowfall

Makes it snow on any web page or specific element.
http://loktar00.github.io/JQuery-Snowfall/
712 stars 221 forks source link

More then one image #24

Open adgrafik opened 9 years ago

adgrafik commented 9 years ago

Thanks for this usefull extension! The most other don't support images. In this case I have adapted your script for my needs to support more then one image and think it can be useful:

search:

                if(options.image){
                    flakeMarkup = $(document.createElement("img"));
                    flakeMarkup[0].src = options.image;
                }

replace:

                if(options.image){
                    flakeMarkup = $(document.createElement("img"));
                    flakeMarkup[0].src = options.image;
                }else if(options.images){
                    flakeMarkup = $(document.createElement("img"));
                    flakeMarkup
                        .hide()
                        .attr('src', options.images[random(0, options.images.length - 1)])
                        .load(function() {  
                            $(this).fadeIn();  
                        });
                }
loktar00 commented 9 years ago

Nice Ill modify this a bit and add it to the script thanks!