2

I have the following code and for whatever reason, my end option doesn't seem to want to call the function it's supposed to. Any ideas?

$(document).ready(function() {
    $('#weareepic').cycle({ 
        fx:      'fade', 
        speed:    1000, 
        timeout:  1500,
        nowrap: 1,
        end: function() {
            $('#bigshots').fadeout(1500);
        }
    });
});

Much appreciated folks!

OptimizedQuery
  • 1,262
  • 11
  • 21
user975876
  • 63
  • 1
  • 1
  • 7

2 Answers2

1

'fadeout' should be the camel cased 'fadeOut'.

Javascript errors in jquerys ajax call can be hidden due to being caught by jquery. I recommend using a debugger if something seems amiss.

Kyle
  • 1,019
  • 1
  • 10
  • 19
  • @Pete - this is a valid answer; javascript is case sensitive; getting the case wrong is an easy error to miss and would indeed be causing the code to break. It may or may not be the only problem in the question, but it is a bug, and this answer is correct to point it out. – Spudley Apr 25 '13 at 14:15
  • That was it! Thanks folks! Sorry for such a lame question, I can't believe I didn't notice that. – user975876 Apr 25 '13 at 14:29
0

You have to use end in conjonction with autostop otherwise your end callback function won't be called:

$(document).ready(function() {
    $('#weareepic').cycle({ 
        fx:      'fade', 
        speed:    1000, 
        timeout:  1500,
        nowrap: 1,
        autostop: true,
        end: function() {
            $('#bigshots').fadeOut(1500);
        }
    });
});

You can then restart cycle from end callback function.

A. Wolff
  • 74,033
  • 9
  • 94
  • 155