0

I have a javascript function I using jquery and jquery-timing that loops through an ul of images and text changing opacity.

function gridautomate() {

griditem.repeat().each($).find("img").animate({"opacity" : "1"},500, $).wait(7000).wait(noHover).animate({"opacity" : ".5"}, 500, $);
griditem.repeat().each($).find(".quote").animate({"opacity" : "1"},500, $).wait(7000).wait(noHover).animate({"opacity" : "0"}, 500, $);

};

I have another function that changes does the same but on hover.

function gridanimate() {

griditem.hover(

    function(){
    $(this).find("img").animate({"opacity" : "1"},0);
    $(this).find(".quote").animate({"opacity" : "1"},0);
    },

    function(){
    $(this).find("img").animate({"opacity" : ".5"},0);
    $(this).find(".quote").animate({"opacity" : "0"},0);
    gridautomate();
    }

);

}

What I would like to do is toggle starting the 1st function on hover i.e. stop on hover in and start on hover out. Can't figure it out.

morten.c
  • 3,414
  • 5
  • 40
  • 45
thesrpr
  • 1
  • 1

1 Answers1

0

i am not understanding the question. though you can look into the stop() method stop()

$('#hoverme-stop-2').hover(function() {
  $(this).find('img').stop(true, true).fadeOut();
}, function() {
  $(this).find('img').stop(true, true).fadeIn();
});
Ravi Gadag
  • 15,735
  • 5
  • 57
  • 83
  • You can see an example here [link](http://thesrpr.com/jvs) I want the animation loop to stop when one hovers over an image. I tried stop. No dice – thesrpr Apr 02 '13 at 08:04