Skip to content

Instantly share code, notes, and snippets.

/*===============================================
= Auto play youtube video =
===============================================*/
var videosrc=$("iframe").attr("src")+"&autoplay=1";
$("iframe").attr("src",videosrc);
/*===== End of Auto play youtube video ======*/
/*================================================
= Anchor tag scroll hijack =
================================================*/
// Select all links with hashes
$('a[href*="#"]')
// Remove links that don't actually link to anything
.not('[href="#"]')
.not('[href="#0"]')
.click(function(event) {
// On-page links
$(function () {
$(".staff-filter__menu li").on('mouseenter mouseleave', function (e) {
if ($(this).children('ul').length) {
var elm = $(this).children('ul');
var off = elm.offset();
var l = off.left;
var w = elm.width();
var docW = $(window).width();
var isEntirelyVisible = (l + w + 20 <= docW);
/**************************
* Movie controls
*************************/
if($("#lens-video").length) {
var moviecontainer = document.getElementById("lens-video"),
movie = moviecontainer.querySelector("video"),
controls = moviecontainer.querySelector("span");
movie.removeAttribute("controls");
controls.style.display = "block";