Help need to merge two functions for jquery cycle? -


I have two functions that I want to use before jquery cycle with callback. The pager is slid through the one as a user cycle, and in other other centers the image is inside the horizontally and vertically attached divas. Both work differently, but I can get them to work together before the callback. I have an example that shows what I still have, still the slide function is set after the callback. -

Even though I have a code.

  $ (function () {$ ('# photo-slideshow'). Cycle ({timeout: 0, next: '# -btn', previous: '# prev-btn', First: Align, after slide: Pager: '# NAV', // Callback FN creates a thumbnail to use as a pager anchor pager anchor builder: function idx, slide) {return ' & lt; ('# Click the button (function ()). ('Pause' (return);); $ ('# play-btn') (function () {$ ( '# Photo-slideshow') cycle ('resume'); return false;}) // align image function alignment (curr, next, opts) {// center image var $ slide = $ ( Next); var w = $ slide.outerWidth (); var h = $ slide.outerHeight (); $ slide.css ({margin top: (800 - h) / 2, margin lift: (800 - w) / 2 }; // DIVs vertically from the centers !!!! var divHeight = 800; Var theImageHeight = $ slide.outerHeight (); var newTopMargin = (divHeight - theImageHyight) / 2; if (theImageHeight & gt; 800) {$ ('# photo-slideshow') CSS ({margin top: newtepe margin}); } // adds captions and credit line $ ('# photo-info'). Html (this.title) .append ('& lt; p & gt;' + "Credit:" + this.alt + ' 

Before the callback, both of them will be greatly appreciated for getting this work done!

Maybe I am misunderstanding this question, but you can not do this:

  ago: function (a, b, c, d) {align (a, b, c); Slide (A, B, C, D); }  

?? In other words, just set the "first" handler in a function that calls your second two functions. If you want, you can write it as a separate function:

  function callboth (A, B, C, D) {align (A, B, C, D); Slide (A, B, C, D); }  

To make it a bit less ugly, you can:

  function callboth () {align.apply (this, argument); Slide.apply (this, argument); }  

Comments