Skip to content

Instantly share code, notes, and snippets.

View macikokoro's full-sized avatar

Joaquin Guardado macikokoro

View GitHub Profile
@macikokoro
macikokoro / Inline
Created April 27, 2014 06:32
CSS Code to display divs next to each other horizontally.
div {
height:100px;
width:100px;
display: inline-block;
}
#red {
background-color:#FF0000;
}
@macikokoro
macikokoro / Aligned divs
Created April 27, 2014 06:39
HTML for horizontally aligned divs.
<html>
<head>
<link rel="stylesheet" type="text/css" href="stylesheet.css"/>
<script type="text/javascript" src="script.js"></script>
</head>
<body>
@macikokoro
macikokoro / Button code.
Created April 27, 2014 07:25
HTML code for a button.
<div><br/><strong>Click Me!</strong></div>
@macikokoro
macikokoro / button
Created April 27, 2014 07:28
CSS for a button.
div {
height: 60px;
width: 100px;
border-radius: 5px;
background-color: #69D2E7;
text-align: center;
color: #FFFFFF;
font-family: Verdana, Arial, Sans-Serif;
opacity: 0.5;
}
@macikokoro
macikokoro / fade
Created April 27, 2014 07:30
Interactive jQuery code for a button.
$(document).ready(function() {
$('div').mouseenter(function() {
$('div').fadeTo('fast', 1);
});
$('div').mouseleave(function() {
$('div').fadeTo('fast', 0.5);
});
});
@macikokoro
macikokoro / Function
Last active August 29, 2015 14:00
jQuery sample function.
$(document).ready(function(input01, input02, input03){
$('div').slideDown("slow");
});
});
<script>
var random, result;
var findDifference = function(answer, guess) {
if (answer > guess) {
return answer - guess;
}
else {
return guess - answer;
}
}
@macikokoro
macikokoro / objects.html
Created June 11, 2014 21:19
Fun JavaScript game based on the rabbit and the turtle story.
<script>
var turtle, rabbit,monkey, km;
function Animal(name, speed, focus) {
this.name = name;
this.speed = speed;
this.position = 0;
this.focus = focus;
@macikokoro
macikokoro / forLoop.js
Last active August 29, 2015 14:02
Basic for loop
// for (start; stop; how much to change each time)
//if we change counter + 1 for counter + 2 console.log will print our every two numbers)
for (var counter = 1; counter <= 5; counter = counter + 1 )
{
// Everything in the code block starting with '{' and
// ending with '}' will run once each time through the loop
console.log(counter);
}
console.log("End of loop!");
@macikokoro
macikokoro / square.js
Created June 14, 2014 23:15
for loop that displays squares of numbers 1 through 100
for (var i = 1; i <=150; i++) {
console.log(i*i);
}