Skip to content

Instantly share code, notes, and snippets.

@onefriendaday
Created August 31, 2015 12:25
Show Gist options
  • Save onefriendaday/8e5058542751922b2711 to your computer and use it in GitHub Desktop.
Save onefriendaday/8e5058542751922b2711 to your computer and use it in GitHub Desktop.
(function ($) {
$(document).ready(function () {
if (['#download-container', '#video-container'].indexOf(window.location.hash) > -1 || window.location.hash.indexOf('video-play') > -1) {
if (window.location.hash.indexOf('video-play') > -1) {
var container = $('#video-container');
} else {
var container = $(window.location.hash);
}
$(container).show();
$('html, body').animate({
scrollTop: container.position().top
}, 500);
var hash = window.location.hash;
var vid = hash.substring(12);
if (vid) {
$('.image a[href$="' + vid + '"]').click();
}
}
});
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment