Help a newb out? fadein/out
So I have this school project that I am making for my web dev final and I am using this jquery I found online. Being that this is not a javascript class we don't really learn about how javascript works but are able to use it on our finals.
Unfortunately I don't have enough time to learn it as of this semester being that it's almost over and was wondering if anyone would help me out with tweaking some of the code on this script so that the pulse is a lot slower.
As well I am wondering if there is any way to make the randomization stay random, it seems as though after a while the pulse will start organizing with other elements and pulse in unison.
here is the code the class that you use is called hot. (It's just what was used don't ask)
<script type="text/javascript"> $.fn.pulse = function(speed){ return this.each(function(){ var that= this setTimeout(function(){pulse.call(that)},Math.random()*1000) }).hover(stop,pulse) function pulse(){ $(this).animate({opacity:0},speed,function(){ $(this).animate({opacity:1},speed,pulse) }) } function stop(){ $(this).stop(false,false).css({opacity:1}) } } $(function(){ $('.hot').pulse('slow') }) </script>Posted Nov 30, 2012, 5:10 PM UTC
Here is some context as to how I am using it, I have a photogallery that I made myself that I applied the class to all the images. I was thinking I could get all of the images (30+ images) to fade in and out slowly, I am thinking that if the pulse was slower there would be less of a chance they start pulsing in unison.