Skip to content

Instantly share code, notes, and snippets.

@ryarwood
Last active February 10, 2016 17:06
Show Gist options
  • Save ryarwood/58cc82c525f184dcef2b to your computer and use it in GitHub Desktop.
Save ryarwood/58cc82c525f184dcef2b to your computer and use it in GitHub Desktop.
Video Swap Javascript
$(document).ready(function(){
$(".top10_video").fitVids();
$(".top10_videolist .active").click(function(event){
event.preventDefault();
});
});
currentFeature = 'videoBox3';
var noonerTitles = [
/* #0 */ "Awesome Tour Recap",
/* #1 */ "Employee Bowling",
/* #2 */ "Bubble Soccer",
/* #3 */ "Luke List Playing Through",
/* #4 */ "TM Welcomes Keegan Bradley",
/* #5 */ "Our Attempt At Indy",
/* #6 */ "Employee Gauntlet",
/* #7 */ "David Kalb Garage Edition",
/* #8 */ "Andy Roddick V James Blake",
/* #9 */ 'Eric Karros "Where is he now?"'
];
var noonerDesc = [
/* 0 */ "Basically, this is what happens when TravisMathew decides to throw a party on a golf course. Chaos, hilarity, and style!",
/* 1 */ "Sometimes we like to have little competitions in the office, and sometimes that requires people dressing up in silly outfits and being used as human bowling balls. Don’t try this at home… or probably anywhere really.",
/* 2 */ "Sometimes we like to have little competitions in the office, and sometimes these competitions involve a soccer ball and using our bodies as giant-inflatable-human-wrecking balls.",
/* 3 */ "We’ve all been there. You get a guy on the course that just won’t get out of the way! PGA Tour Player and Longest Drive of All Time Master Luke List shows you how to get someone out of your way.",
/* 4 */ "Remember that one time we signed Keegan Bradley and he looked better than a Greek God in our clothes? Just making sure you didn’t forget.",
/* 5 */ "We had the random idea to put Professional Racecar drivers behind the wheel of an old, beat-up wagon and see what they could do. As usual, it was a rad idea.",
/* 6 */ "A new employee regretfully didn’t have any TravisMathew gear in his closet, so we decided to give him some product. Of course, we were going to make him work for it a bit…",
/* 7 */ "So, our Tour Bus Manager David Kalb also happens to be a basketball trick-shot wizard. Here’s what he does in his down-time.",
/* 8 */ "We asked TravisMathew team members Andy Roddick and James Blake to take a little break from tennis to square-off in a “fun-filled” competition. They said yes, but probably wished they hadn’t.",
/* 9 */ "Remember that one time we hired baseball legend Eric Karros to run our warehouse… oh, you don’t!? Press play then. The guy he replaced wasn’t too happy, but we think he did a good job."
];
function showFeature(whichFeature,whichVideo,whichNumber) {
var pound = '#';
fadedLink = pound.concat(whichFeature);
pwndLink = pound.concat(currentFeature);
$('.top10_video').fadeOut(500, function() {
$(pwndLink).unbind().removeClass("active");
$(fadedLink).addClass("active");
currentFeature = whichFeature;
currentLink = fadedLink;
var htm = '<iframe width="1110" height="625" src="//www.youtube.com/embed/' + whichVideo + '?wmode=transparent&rel=0&theme=dark&color=white&autoplay=1&showinfo=0" frameborder="0" allowfullscreen></iframe>'
$('.top10_video').html(htm);
$('.top10_Title').html(noonerTitles[whichNumber]);
$('.top10_Desc').html(noonerDesc[whichNumber]);
$(".top10_video").fitVids();
$('.top10_video').fadeIn(1000);
});
$(".top10_videolist .active").click(function(event){
event.preventDefault();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment