Add a firefly effect to your site with jQuery fireFly

Add fireflies to your site with jQuery fireFly plugin

This is a guest post by Motyar, a fellow developer from India.

Hi, this is Motyar D, Web services and API developer. I want to introduce you with my new jQuery plugin named fireFly. As the name says, the plugin can be used to add firefly effect on any web page background. Last month I updated it to work on a particular div background too. I hope you will find it helpful.

Demos

Download

You can download the plugin on github. Also, feel free to fork!

How to use

Include jQuery and the plugin file

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src=" https://raw.github.com/motyar/firefly/master/jquery-firefly-0.2.js "> </script>

Call the plugin

$(document).ready(function() {
 $.firefly({
     images : ['images/fly1by1.png', 'images/fly2by2.png'], //You can change images
     total : 65 // You can edit the number of flies
 });
});

If you want the fireFly effect limited inside a div you can add on: '#divID', like this:

$(document).ready(function() {
   $.firefly({
     images : ['images/fly1by1.png', 'images/fly2by2.png'], //You can change images
     total : 65, // You can edit the number of flies
     on: '#header' // id of div
  });
});

About the author

I am Motyar D Web services and API developer.

I am on twitter: @motyar
My blog: http://motyar.blogspot.com
You can get more about me on Google+


Comments

k24  •  February 2, 2012 23:31

Really nice effect, thanks for sharing! But it's impossible to make the sparks fly under something else than a , unless you change the name of the div in the script (line 73, replace "$("#header").append(spark);" with "$("#firefly").append(spark);" for example), set z-index to '1' (line77) and add this div in the html.

David  •  March 20, 2012 14:49

Hello, I love this plugin but for some reason I can't get it to work! I followed all the steps above an it's still not working. Anybody else having this problem?

David  •  March 22, 2012 13:36

I really want to use this for my site, can anyone help me it's not working??? I followed the first two steps above (Included jQuery and the plugin file and called the plugin). Is that all?

David  •  March 22, 2012 14:09

Finally got it to work! Great plugin, I love it : )

Chan Luu Costume Fashion Jewellery  •  April 6, 2012 10:37

I would like to thank you for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now.

Motyar  •  April 27, 2012 21:32

Thank you all!

ecoresin Minneapolis  •  May 19, 2012 13:51

Our Global Trends is committed to providing the highest quality architectural materials and sustainable products and services.

Post your comment

(optional)
(optional, will not be shown)
NOTE: Any links will have rel="nofollow"

back