Jump to content

CrossSlide jQuery slide-show and PW?


antknight
 Share

Recommended Posts

http://tobia.github.com/CrossSlide/

I would like to use the CrossSlide jQuery plugin with PW, in particular the Ken Burns effect, but how would I use PW to output the source images into the CrossSlide code?

I am pretty with sure other slideshows, you can just list the source images in the HTML, which would be simple, but I like to make things difficult!

Thanks

Link to comment
Share on other sites

Taking the first example from the CrossSlide site, you could do it like this:


<script type='text/javascript'>
$(document).ready(function() {
 $('#placeholder').crossSlide({
   sleep: 2,
   fade: 1
 }, [
   <?php
   $o = '';
   foreach($page->images as $img) $o .= "{ src: '$img->url' },";
   echo rtrim($o, ",");
   ?> 
 ]);
}); 
</script>

I'm stuffing it into the variable $o before echoing it just so that I can trim off the trailing comma, which prevents a JS error in some browsers.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...