This is actually done automatically if you set the data-cycle-allow-wrap
option set to false
in the cycle HTML. It will add the class disabled
to the prev/next control if it is at the beginning/end of the slideshow. Then you just use CSS to style it so it hidden, or grayed out. No extra Javascript needed.
Here is a fiddle example: http://jsfiddle.net/X3kYY/