Skip to content

Instantly share code, notes, and snippets.

@ray-peters
Created January 28, 2016 23:00
Show Gist options
  • Select an option

  • Save ray-peters/2dadc6f7bd9022dcce40 to your computer and use it in GitHub Desktop.

Select an option

Save ray-peters/2dadc6f7bd9022dcce40 to your computer and use it in GitHub Desktop.
$( document ).ready(
function() {
//$('*[opt-id="74478fdc-1885-0eba-36ab-4387fd0c15bb"]').hide();
//$("a[href='http://ontraport.com/fakelink']").attr('href', 'javascript:show_chapters()');
var navIsOn = false;
$( document.body ).on( "click", "a[href='http://ontraport.com/fakelink']", function( ev ){
if ( navIsOn ) {
hide_chapters();
navIsOn = false;
} else {
show_chapters();
navIsOn = true;
}
ev.preventDefault();
} );
}
);
function show_chapters() {
$('*[opt-id="74478fdc-1885-0eba-36ab-4387fd0c15bb"]').show();
//$("a[href='javascript:show_chapters()']").attr('href', 'javascript:hide_chapters()');
}
function hide_chapters() {
$('*[opt-id="74478fdc-1885-0eba-36ab-4387fd0c15bb"]').hide();
//$("a[href='javascript:hide_chapters()']").attr('href', 'javascript:show_chapters()');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment