I'm trying to load the Cycle plugin with a JSON feed from Picasa.
Everything is pulling in from Picasa just fine.  I can copy the exact
HTML that it generates and paste it into my code and reload, and it
works fine, but not when it is dynamically added via Javascript.

http://derekperkins.com/seatability/super-product-page/

Here is my javascript code that pulls in the feed from Picasa and then
initializes Cycle.  I also automatically generate the thumbnails for
the pager here too.  Does Cycle read from the raw html rather than
from generated html?  If so, how do I get around that?

********************************

jQuery(document).ready(function()
{
        jQuery.getJSON("http://picasaweb.google.com/data/feed/api/user/
Seatability/albumid/5301645629882336001/?
kind=photo&access=public&alt=json&callback=?", function(data)
        {
                var picsCount = data.feed.entry.length;
        for (var i = 0; i < picsCount; i++)
                {
                var pic = data.feed.entry[i];
                        jQuery("<img/>").attr("src", 
pic.media$group.media$content[0].url +
"?imgmax=400").attr("alt", pic.summary.$t).appendTo("#slideshow").wrap
("<a href='" + pic.media$group.media$content[0].url + "' /></
a>");
        }
        });

        jQuery('#slideshow').after('<ul id="cycle_nav">').cycle
        ({
        fx:     'uncover',
        speed:  'slow',
        timeout: 0,
        pager:  '#cycle_nav',
        direction: 'down',
        timeout:  1000,
                prev:    '#slidePrev',
        next:    '#slideNext',
                fit:      1,
                containerResize: 0,


        // callback fn that creates a thumbnail to use as pager
anchor
        pagerAnchorBuilder: function(idx, slide)
                {
            return '<li><a class="thumbnav" href="#"><img src="' +
slide.getElementsByTagName('img')[0].src + '" /></a></li>';
        }
    });
});

***************** Generated HTML from Picasa feed that works if pasted
in manually. *******************

<a href="http://lh4.ggpht.com/_hTnqBRd-Qmo/SZM6oXszvlI/AAAAAAAAAPY/
ANmG-G02BVM/s288/IMGP6265.jpg"><img alt="" src="http://lh4.ggpht.com/
_hTnqBRd-Qmo/SZM6oXszvlI/AAAAAAAAAPY/ANmG-G02BVM/IMGP6265.jpg?
imgmax=400"></a><a href="http://lh4.ggpht.com/_hTnqBRd-Qmo/SZM6otsq0OI/
AAAAAAAAAPg/xToZaXLi2tE/s288/IMGP6266.jpg"><img alt="" src="http://
lh4.ggpht.com/_hTnqBRd-Qmo/SZM6otsq0OI/AAAAAAAAAPg/xToZaXLi2tE/
IMGP6266.jpg?imgmax=400"></a><a href="http://lh4.ggpht.com/_hTnqBRd-
Qmo/SZM6o1udIwI/AAAAAAAAAPo/_gUFLYyDjLk/s288/IMGP6268.jpg"><img alt=""
src="http://lh4.ggpht.com/_hTnqBRd-Qmo/SZM6o1udIwI/AAAAAAAAAPo/
_gUFLYyDjLk/IMGP6268.jpg?imgmax=400"></a><a href="http://lh3.ggpht.com/
_hTnqBRd-Qmo/SZM6pL3_ZSI/AAAAAAAAAPw/STx3W1QPapc/s288/
IMGP6267.jpg"><img alt="" src="http://lh3.ggpht.com/_hTnqBRd-Qmo/
SZM6pL3_ZSI/AAAAAAAAAPw/STx3W1QPapc/IMGP6267.jpg?imgmax=400"></a><a
href="http://lh5.ggpht.com/_hTnqBRd-Qmo/SZM6pYcsgLI/
AAAAAAAAAP4/6ewbXYZBZq4/s288/IMGP6269.jpg"><img alt="" src="http://
lh5.ggpht.com/_hTnqBRd-Qmo/SZM6pYcsgLI/AAAAAAAAAP4/6ewbXYZBZq4/
IMGP6269.jpg?imgmax=400"></a><a href="http://lh6.ggpht.com/_hTnqBRd-
Qmo/SZM6psNoMAI/AAAAAAAAAQA/JSScuW051S8/s288/IMGP6270.jpg"><img alt=""
src="http://lh6.ggpht.com/_hTnqBRd-Qmo/SZM6psNoMAI/AAAAAAAAAQA/
JSScuW051S8/IMGP6270.jpg?imgmax=400"></a>

Reply via email to