Skip to content

Instantly share code, notes, and snippets.

@aarongustafson
aarongustafson / dependent-anchor-include.js
Last active December 19, 2015 01:38
Scott Jehl’s Anchor Include Pattern (https://gist.github.com/scottjehl/d0e4918cf5e97edf99f3) combined with Emil Bjorkund’s Width Detection (https://gist.github.com/emilbjorklund/2481019)
/*! Dependent Anchor Include Pattern */
/*
* Copyright 2011, Scott Jehl (scottjehl.com), Emil Bjorklund (thatemil.com),
* and Aaron Gustafson (aaron-gustafson.com)
*
* Dual licensed under the MIT
* Idea from Scott Gonzalez
*
* to use, place attributes on an already-functional anchor pointing to content
* that should either replace, or insert before or after that anchor