Skip to content

Instantly share code, notes, and snippets.

@madcatgith
Last active June 21, 2016 11:50
Show Gist options
  • Save madcatgith/bb1048cbdf9b37afece1cd2220940341 to your computer and use it in GitHub Desktop.
Save madcatgith/bb1048cbdf9b37afece1cd2220940341 to your computer and use it in GitHub Desktop.
js for phone hiding under spoiler
//Show phone number
/*
class=".phone_show";
data-last="$value"
*/
$(document).ready(function(){
if ($.cookie('phone_show')){
$('.phone_show').each(function(i,elem){
$(this).text($(this).data('last'));
$(this).removeClass();
});
}
});
$('.phone_show').on('click',function(){
$.cookie('phone_show','true');
ga('send','event','button','click','phone');
$('.phone_show').each(function(i,elem){
$(this).text($(this).data('last'));
$(this).removeClass();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment