Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
jQuery .wrapAll issues... :(
Old 08-27-2009, 10:06 PM jQuery .wrapAll issues... :(
Novice Talker

Posts: 14
Name: Alex Stubbs
Trades: 0
I'm working with a script to pull videos from vimeo.com through the API. The script works and pulls in all the videos... into one large unordered list (ul). I need to style the video titles into three's... so it would be best to have a ul between each 3 li's. I can add a class name by adding a tag to the video and pulling it in ({tags} pulls GROUP1 which i use to set as a class for 3 of the videos}

When i try to use jQuery to find the three LI's with the div class of 'GROUP1' and wrap them in their own UL via .wrapAll... it doesn't work! Any Ideas????

See code:


Code:
function buildLevel1Videos(albumset) {

        videosUrl = 'http://www.vimeo.com/api/v2/user2109850/videos.json?callback=?'

    template = "<div class='{tags}'><li><a href='javascript:void(0);' class='video-link'>{title}</a></li></div>";

containerLevel1 = $('#thumbs');
    videoList = [];
    userVideos = [];

    $.getJSON('videos.php', function(data){
        $.each(data.videos, function(i, video){
            userVideos.push(video.videoid);
        });
    });

    $.getJSON(videosUrl, function(data) {
        var thumbs = $('<ul class="vset"></ul>')
        $.each(data, function(i, video){
                    
            $('.GROUP1').wrapAll("<div class='omk'></div>");

            thumbs.append($.nano(template, video)); 
            videoList.push(video.id);

        });
        containerLevel1.html(thumbs);

        videosToWatch = $.grep(videoList, function(videoId, index){
            return $.inArray(videoId, userVideos) == -1
        });

          $.each(videosToWatch, function(i,videoId){
            if(i > 0){
                //$('#'+videoId).parent('a').addClass('disabled');
                $('#'+videoId).parent('a').animate({opacity:0.2});
            }
            else {
              userVideos.push(videoId);
            }

        });

Last edited by alexjames01; 08-27-2009 at 10:08 PM..
alexjames01 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to jQuery .wrapAll issues... :(
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16115 seconds with 12 queries