Try it like this:

$("#fade").load("pictures.php", function() {
    $(this).cycle();
});

This will kick off Cycle *after* your slides have been added to the
DOM.  But note that if the slides are images then they are not
necessarily downloaded and available yet.  To deal with that it works
well to have a couple images statically declared and then add the rest
dynamically.

Mike


On Nov 20, 2007 11:30 AM, EvilMotter <[EMAIL PROTECTED]> wrote:
>
> The Cycle plugin for jQuery http://www.malsup.com/jquery/cycle/ , wont
> work if i load the images to be "cycled" with ajax.
>
> This works as the pictures are staticly on the page, like on the cycle
> webpage:
> $(function()
>         {
>                 // run the code in the markup!
>                 $("#fade").cycle();
>         }
> );
> #fade:
> <div id="fade" class="pics">
> <img src="img1.jpg" width="200px" height="200px" />
> <img src="img2.jpg" width="200px" height="200px" />
> </div>
>
> But if i want to load the pictures from a file using some basic Ajax
> it doesn't do anything than displaying the first picture, a closer
> look in FireBug, shows that the pictures have been loaded correctly
> into the page.
> $(function()
>         {
>                 $("#fade2").load("pictures.php");
>                 // run the code in the markup!
>                 $("#fade").cycle();
>         }
> );
>
> #fade:
> <div id="fade" class="pics">
> </div>
> pictures.php:
> <img src="img1.jpg" width="200px" height="200px" />
> <img src="img2.jpg" width="200px" height="200px" />
>
> Am I doing something completely wrong or is this just a no go ?
>
> .EvilMotter
>

Reply via email to