I am using flexslider. There is an example under the advanced tap on this page (in the section "The new, robust Callback API" where they use slider.currentSlide
to get the number of the current slide.
How can I access this value in a completely different function? I am thinking of a global variable but I don't know if that will work and I don't know if it's possible to declare a variable within a function as global.
You can avoid global variables by accessing the flexslider object with:
$(element).data('flexslider')
So in your case you'd use:
$(element).data('flexslider').currentSlide