NBA lottery machine: Mock draft for every scenario

by Jonathan Givony, ESPN Insider

CHANCE TO WIN LOTTERY


Processing your lottery results.

Welcome to the ESPN NBA Lottery Mock Draft

‘; }); $teamsRow.html($teamsToInsert); $gridPlayers.html($playersToInsert); $gridPlayers.show(); }).done(function() { var $button = $(“#btn-lottery”); $button.on(‘click’, function(e) { e.preventDefault(); if ($(this).hasClass(“open”)) { return false; } else { var ht = $(“#lottery-body”).height() * 1 + 23; $(“#lottery-drawer”).animate({ ‘height’ : ht }, 300, “easeInOutQuad”, function() { $(“#btn-lottery”).addClass(“open”); $(“#lottery-drawer-body”).fadeIn().height(ht); rotate(images); }); } }); }); } function regenerate() { $(“#grid-players”).hide(); var play = Math.floor(Math.random() * (2000 – 1)) + 1; $.getJSON(‘lotteryDataAPI?play=’+play, function(data) { var $gridTeams = $(“#grid-teams”), $tabsPlayers = $(“#tabs-players”), $tabText = ”, $tabPlayersText = ”; $gridTeams.empty(); $tabsPlayers.html(”); $.each(data.picks, function(key, val) { var image_url_dark = ‘http://a.espncdn.com/combiner/i?img=/i/teamlogos/nba/500-dark/’ + val.team.teamAbbrev.toLowerCase() + ‘.png?w=40&h=40&transparent=true’, image_url_lht = ‘http://a.espncdn.com/combiner/i?img=/i/teamlogos/nba/500/’ + val.team.teamAbbrev.toLowerCase() + ‘.png?w=40&h=40&transparent=true’, image_url_lrg = ‘http://a.espncdn.com/combiner/i?img=/i/teamlogos/nba/500/’ + val.team.teamAbbrev.toLowerCase() + ‘.png?w=170&h=170&transparent=true’; $tabText += ‘

  • ‘ + val.pick + ‘.‘; if (key == 0) { $tabText += ‘‘ + val.player.playerName + ‘‘ + val.chanceToWin + ‘ CHANCE TO WIN’ + ‘‘} else { $tabText += ‘‘ + val.player.playerName + ‘‘; } $tabText += ‘
  • ‘; $tabPlayersText += ‘

    ‘ + val.pick + ‘.

    Height: ‘ + val.player.height + ‘ | Weight: ‘ + val.player.weight + ‘ | ‘ + val.player.className + ‘

    ‘ + val.player.college + ‘ | ‘ + val.player.position + ‘

    ‘ + val.body + ‘

    ‘; }); $(“.tabs”).append($tabText); $tabsPlayers.append($tabPlayersText); $(“.tab-text-bio u”).prepend(“
    “); $(“.tabs”).children().addClass(“tab”); $(“.tab-data”).eq(0).fadeIn(); $(‘p#content-text’).html(‘

    Back

    ‘); $(‘a#btn-lottery’).text(‘Replay Lottery’); $(“.tabs li a”).on(“click”, function(e) { e.preventDefault(); $(this).parent().addClass(“active”).siblings().removeClass(“active”); var num = $(this).parent().index(); $.when($(“.tab-data”).fadeOut(“slow”)).done(function() { $(“.tab-data”).hide(); $(“.tab-data”).eq(num).fadeIn(); }); }); $(“.tabs .tab”).eq(0).addClass(“active”); $(“#tabs-players”).show(); }); } $(window).load(function() { initialize(); }); })(jQuery);

    Leave a Response