Skip to content

Instantly share code, notes, and snippets.

View juliojacob's full-sized avatar

Julio Jacob juliojacob

View GitHub Profile
@juliojacob
juliojacob / bg_entire.js
Created November 30, 2011 22:04
Background em tela inteira (proporcional) - Java Script
//ajusta a imagem para ocupar toda a tela
function fitToStage(image)
{
var propX = 1680 / $(window).width();
var propY = 1050 / $(window).height();
propX > propY ? fitStageHeight(image) : fitStageWidth(image);
}
//ajusta a largura proporcionalmente
@juliojacob
juliojacob / html5.js
Created November 30, 2011 21:55
Reconhecimento das tags HTML5 - Java Script
<script type="text/javascript">
document.createElement('header');
document.createElement('hgroup');
document.createElement('nav');
document.createElement('menu');
document.createElement('section');
document.createElement('article');
document.createElement('aside');
document.createElement('footer');
document.createElement('video');
@juliojacob
juliojacob / bg_slideshow.html
Created November 30, 2011 21:54
Slideshow no Background - xHTML + Java Script
<html>
<head>
<style>
body{ background-repeat: no-repeat;}
</style>
</head>
<script language="JavaScript">
<!--
// =======================================
// variáveis
@juliojacob
juliojacob / mobile_bg.css
Created November 30, 2011 18:38
Trocar o background de acordo com a orientação do dispositivo - HTML5 + CSS3
@charset "utf-8";
body{ background-color:#3F3;}
@media screen and (orientation:landscape){
body{ background-color:#C30;}
}
@juliojacob
juliojacob / zoom.html
Created November 30, 2011 18:24
Bloquear o zoom do iPad/iPhone - HTML5
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<meta name='viewport' content='user-scalable=no' />
<title>Bloqueando o zoom do iPad</title>
</head>
<body>
</body>
@juliojacob
juliojacob / senha_simples.html
Created November 30, 2011 14:37
Inclusão de Senha Simples - xHTML + Java Script
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
//SENHA
var senha = '1234';
//funcao
function entra(){
@juliojacob
juliojacob / formulario.html
Created November 30, 2011 14:33
Validação de Formulário - xHTML + Java Script
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="valida_form.js" type="text/javascript"></script>
<style>
label {
display: block;
margin: 5px 0;
}