This file contains hidden or 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
$(function() { // on document ready | |
$('#tabs li').on('click', function(event) { | |
// Every <a> on the page? | |
// $('a').parent().removeClass('tab-current'); | |
$(this).siblings().removeClass('tab-current'); | |
$(this).addClass('tab-current'); | |
// Every <section> on the page? | |
// $('section').removeClass('content-current'); |
This file contains hidden or 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
body { | |
font-family: Arial, sans-serif; | |
color: cornflowerblue; | |
} | |
.tabs { | |
position: relative; | |
width: 100%; | |
margin-top: 1em; |
This file contains hidden or 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
/*missing / broken images | |
body text: cornflower blue | |
non-default font: ??? | |
tabs! | |
decorative icons next to each tab | |
laid out side-by-side (horizontally) | |
bottom border under all tabs except active | |
spacing between tabs: ???px / ???pt | |
active tabs: | |
top border is heavier |
This file contains hidden or 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
(function (window) { // IIFE: Immediately Invoked Function Expression | |
'use strict'; // For bonus points, what does this do? | |
// CONTROLLER FOR: I can add a task to my list... | |
// 1. What event should I be listening for? keydn, keyup, keypress | |
// 2. What element makes sense to listen for that event? input.new-todo | |
// 3. What do I need to do when that event fires? | |
// GIVEN an HTML element <input class="new-todo"> | |
var newTodoInput = document.querySelector('input.new-todo'); |
This file contains hidden or 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
(function (window) { // IIFE: Immediately Invoked Function Expression | |
'use strict'; // For bonus points, what does this do? | |
var list = [ ]; | |
console.log(list); | |
todos.addTaskToList("Remember the milk", list); | |
console.log(list); |
This file contains hidden or 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
$> todos = "Learn Ruby" | |
=> "Learn Ruby" | |
$> todos << " on Rails" | |
=> "Learn Ruby on Rails" | |
$> todos << ", go home happy" | |
=> "Learn Ruby on Rails, go home happy" | |
$> todos.split | |
=> ["Learn", "Ruby", "on", "Rails", "go", "home", "happy"] | |
$> todos.split ',' | |
=> ["Learn Ruby on Rails", " go home happy"] |
This file contains hidden or 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
// Just a tracer... | |
// alert("It's alive!"); | |
debugger; | |
document.head.parentElement.className="js"; // It's alive! | |
var elements = document.querySelectorAll('.cbp-nttrigger'); | |
// var nestedElements = document.querySelectorAll('h4'); | |
// elements[0].addEventListener('click', function(){ | |
// elements[0].parentElement.classList.toggle('cbp-ntopen'); |
This file contains hidden or 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
// function definition | |
function addition(a, b /* paramters go here */){ | |
// function body | |
return a + b; | |
} | |
// function invocation | |
addition(3, 5 /* arguments go here */); // yields 8 | |
addition(2, 7); // yields 9 |
This file contains hidden or 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
<style> | |
nav > a { display: inline-block; } | |
</style> | |
<nav> | |
<a href="#">A giant tile link</a> | |
<a href="#">Another tile link</a> | |
</nav> |
This file contains hidden or 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
<!DOCTYPE html> | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title> TIY Catalog -- TheIronYard does Etsy right </title> | |
<meta name="description" content=""> |