cycle opts.addslide problem
I'm trying to use the JQuery Cycle modules opts.addSlide() for a lobby screen. I don't seem to be able to get it running. Does the slide show already have to have content for addSlide to work. Perhaps my noobish syntax is way off. No errors are thrown. Any suggestions? Thanks.
- var LobbySign = LobbySign || {};
- LobbySign.init = function(){
- //array to hold image urls
- imageUrls = new Array();
- //begin by getting all the initial image urls
-
- $('body img').each(
- function () {
- imageUrls.push( $(this).attr("src") );
- }
- );
-
- $('body').empty();
- $('body').prepend("<div id='slideshow'></div>");
- $('#slideshow').cycle(
- {
- timeout: 2000,
- before: LobbySign.onBefore(imageUrls)
- }
- );
- }
- LobbySign.onBefore = function (curr, next, opts, imageUrls){
- for(var i = 0; i< imageUrls.length; i++){
- opts.addSlide(imageUrls[i]);
- }
- }
- $("document").ready(LobbySign.init);