antknight Posted November 23, 2012 Share Posted November 23, 2012 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 More sharing options...
diogo Posted November 23, 2012 Share Posted November 23, 2012 See here how you can create the variables with pw data to use in javascript http://processwire.com/talk/topic/803-tinymce-insert-image-modal-window/#entry20546 1 Link to comment Share on other sites More sharing options...
ryan Posted November 24, 2012 Share Posted November 24, 2012 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. 1 Link to comment Share on other sites More sharing options...
antknight Posted November 24, 2012 Author Share Posted November 24, 2012 Thanks Ryan, that trailing comma was exactly what I was wondering about how to deal with! Link to comment Share on other sites More sharing options...
neildaemond Posted November 25, 2012 Share Posted November 25, 2012 cool, I've never considered this ken burns effect before... looks pretty nice. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now