[jQuery] Re: Cycle: replace slide in running slideshow?

2009-09-01 Thread engineerachu


All these are Okay. But how will it work if there are huge contents in a
div? Example, 100 rows in a DataGrid?

-- 
View this message in context: 
http://www.nabble.com/Cycle%3A-replace-slide-in-running-slideshow--tp25213947s27240p25240553.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Cycle: replace slide in running slideshow?

2009-08-31 Thread Jon Crump


Mike,

Thanks for this. I did find a solution by setting a flag for the first 
time through the cycle since there were other things too I wanted to 
happen only on the first time through. After the #title element is shown, 
I simply replaced its html with a different image and content. A stripped 
down version looks something like this:


jQuery(document).ready(function($){
var firstTime = true;
  $('#cycle').cycle({
fx:'fade',
speed:1500,
timeout:7000,
delay: 5000,
before: doBefore
  });

  function doBefore() {
if (firstTime == true){
  var i = $(.slide).index(this);
  if (i == 1){
$(#title).html(img src='newimage.jpg' / + div 
class='caption'foobar/div);

firstTime = false;
  };
};
  };
});

This seems to work. I gather setting such a global variable is regarded as 
bad form, but in such a small application it seemed harmless. Your 
solution seems to avoids this.


Thanks again, and thanks too for your generosity in developing this very 
generally useful plugin.


Jon

On Sun, 30 Aug 2009, Mike Alsup wrote:




Is there a way to replace the first slide in a running slideshow such
that it's shown only once??


Here's an example of something similar - might give you some ideas:

http://www.malsup.com/jquery/cycle/title.html



[jQuery] Re: Cycle: replace slide in running slideshow?

2009-08-31 Thread Mike Alsup

 This seems to work. I gather setting such a global variable is regarded as
 bad form, but in such a small application it seemed harmless. Your
 solution seems to avoids this.

That's not a global var, its scope is limited to the function passed
to 'ready'.  That's a perfectly valid solution you came up with.

Cheers!


[jQuery] Re: Cycle: replace slide in running slideshow?

2009-08-30 Thread Mike Alsup

 Is there a way to replace the first slide in a running slideshow such
 that it's shown only once??

Here's an example of something similar - might give you some ideas:

http://www.malsup.com/jquery/cycle/title.html