Nick H (Harambee?) used this a while back to update the functionality of my jPlaylister (
http://jplaylister.yaheard.us) for his implementation and I quickly added the code to my code-base because it is a great little feature! The code should be pretty obvious based on below:
playlistOptions: { |
| }, |
| /*auto scroll playlist */ |
| play: function() { |
| $("#jp_playlist_1").animate({ |
| scrollTop: $(".jp-playlist-current").position().top - |
| $("ul#playlist").position().top - ($("#scroll").height()/2) + ($(".jp-playlist-current").height()/2) + 5 |
| }, 2000,'easeOutCirc'); |
| }, |
| /*end autoscroll playlist code from Nick H*/ |
| swfPath: "js", |
| supplied: "mp3, m4v" |
(I also had to add a <div id="scroll"></div> around the playlist item <div id="jp_playlist_1"></div> -- but I don't think anything else was necessary for the code to work.
The code is from him and I just pasted it into the relevant place in my setup code.
As far as play/pause, I feel like you'd have to modify the "onclick" event for the playlist item to point to a function that was aware if the song was playing, and if it was...it would use the built-in play/pause function the play button uses. I don't think I'd bother with it, personally. I'd modify user expectations and have them use the play/pause button...but it probably wouldn't be terrible to do.
Good luck!