On Thu, May 1, 2008 at 1:11 AM, Jeff Friesen <[EMAIL PROTECTED]> wrote: > > I have been working with the addSlideFn. I love the idea, but I am > having some problems implementing it. I have some ideas for improving > it, but first here is what I ran into: > > I got addSlideFn to work in a somewhat simple case. Then I was having > problems though when I tried to set a delay. The newly loaded slides > would "interrupt" the ongoing slideshow. I also used a nowrap option, > and depending on the timing the slideshow would end before the new > slides were added and loaded to the DOM. Since load times over the > internet vary, I don't know how robust that is. > > I tried to decouple the addSlideFn from the slideshow (not using > onBefore) so that I cold load all of the new slides before starting > the slideshow (using a delay), but I couldn't (addSlideFn not a > function..). > > Also, I tried to just use only one slide in the html, and add all of > the others through javascript. I got an error saying I only had one > slide in my slideshow. One way to hide all other slides if javascript > is disabled or during loading is to make sure overflow:hidden; is set > in the parent container. > > Here is what I think is the ideal way to load a complex, progressively > enhanced slideshow (please pitch in other ideas!) > > - only one silde element in the html > - create a setTimeout function that would wait until the DOM and page > elements are loaded. Could be just a simple timer or it could check > to see if all of the page elements are loaded. Once loaded or timer > finishes, slide markup is added to the DOM and the media is loaded > - when the slides added to the DOM and loaded, trigger the slideshow > > I like this solution because: > 1. It allows you to present content after the clunky page loading > process happens (if you have a heavy page) > 2. It could potentially speed up perceived page load because it is > loading heavy images in the background after all other page elements > are loaded > 3. It would be a simple configuration (for us, maybe not Mike or > whoever is doing the coding!) > 4. It follows progressive enhancement - if no javascript, then only > one slide loads > 5. Could potentially allow all of the javascript (jQuery, plugin, and > configuration) at the bottom of the page, which could also speed up > perceived load times. (I have been reading a lot about the speed > optimization work Yahoo is doing and using the yslow tool). > > This might even be possible with the current implementation of cycle > but I don't know how to do it. Any ideas? > thanks
Thanks for the feedback, Jeff. I think the following demos should help you work through these issues: http://www.malsup.com/jquery/cycle/add2.html http://www.malsup.com/jquery/cycle/add3.html http://www.malsup.com/jquery/cycle/add4.html Cheers. Mike