Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// http://cdn.zoker.me/tools/tab-helper.js
$("input:text").focus(function(){
$(this).select();$(this).mouseup(function(a){
a.preventDefault();
})
});
$(window).load(function() {
var hash;
var hash_suffix='_tab';
if(document.location.href.split('#')[1]){
hash='#'+document.location.href.split('#')[1].replace(hash_suffix,'');
}
if(hash){
$('ul.nav.navbar-nav li a[href='+hash+']').tab('show');
}
});
function tabAction(ele){
var selected=$(ele).attr('href');document.location.href="/"+(document.location.search?document.location.search:'')+selected+hash_suffix;hash=selected;
}
function tryIt(n){
window.location.href="/?theme="+n+(hash?hash+hash_suffix:'');
}
function toggleCode(ele,name){
$('#'+name).toggleClass('hidden');$(ele).find('b').toggleClass('icon-caret-down');$(ele).find('b').toggleClass('icon-caret-up');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.