Created
January 14, 2011 22:46
-
-
Save skipjac/780437 to your computer and use it in GitHub Desktop.
hide or show a zendesk widget in the side bar based on a tag in the forum topic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* you can get the widget ID/Number from the widget edit page in the sidebar */ | |
div#widget_189206 { | |
display: none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$j(document).ready(function() { | |
//check to see if you are on the end users request page | |
if (window.location.href.indexOf('entries') >= 0){ | |
$j.getJSON(window.location.href+".json", function(data) { | |
if(data['current_tags'] === 'gist'){ | |
$j('div#widget_189206').show(); | |
} | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment