Skip to content

Instantly share code, notes, and snippets.

@nelhage
Created December 12, 2013 02:16
Show Gist options
  • Save nelhage/7922231 to your computer and use it in GitHub Desktop.
Save nelhage/7922231 to your computer and use it in GitHub Desktop.
function framesLinks() {
$('.framelink').toggle(function() {
$(this).text('links with frames');
$(this).parents('h2').nextAll('.libraries').first().find('li a').each(function() {
$(this).attr('href', $(this).attr('href').replace(/\/frames$/, ''));
});
}, function() {
$(this).text('links without frames');
$(this).parents('h2').nextAll('.libraries').first().find('li a').each(function() {
$(this).attr('href', $(this).attr('href') + '/frames');
});
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment