Skip to content

Instantly share code, notes, and snippets.

@quitequinn
Last active August 29, 2015 14:15
Show Gist options
  • Save quitequinn/ae76170904fb3797f68f to your computer and use it in GitHub Desktop.
Save quitequinn/ae76170904fb3797f68f to your computer and use it in GitHub Desktop.
function compiled(){
???
}
function exFunc(path){
var url = path.replace(/[_]/g, '/');
var index = path;
if (path == "home") {
url = '';
index = "intro";
}
function stuff("#!/" + url){
$(".ex").attr("cur-slide", index)
$('.ex a[href$="#!/'+url+'"]').addClass('view-on');
}
}
consol.log(compiled(exFunc("#intro_1").attr("id"));
consol.log(compiled(exFunc("#home").attr("id"));
// It would console log
// function exFunc("intro_1"){
// var url = "intro/1";
// var index = "intro_1";
//
// function stuff("#!/intro/1"){
// $(".ex").attr("cur-slide", "intro/1")
// $('.ex a[href$="#!/intro/1"]').addClass('view-on');
// }
// }
//
// function exFunc("home"){
// var url = "home";
// var index = "home";
// if (path == "home") {
// url = '';
// index = "intro";
// }
//
// function stuff("#!/"){
// $(".ex").attr("cur-slide", "intro")
// $('.ex a[href$="#!/"]').addClass('view-on');
// }
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment