Skip to content

Instantly share code, notes, and snippets.

View h4's full-sized avatar
💭
I may be slow to respond.

Mikhail Baranov h4

💭
I may be slow to respond.
View GitHub Profile
@h4
h4 / 01.images_length.js
Created April 2, 2012 21:04
Объект image
document.write("Всего: " + document.images.length + " шт. рисунков.");
@h4
h4 / links.html
Created April 2, 2012 21:08
Для задания 05.1
@h4
h4 / location.html
Created April 2, 2012 21:15
Для задания 05.2
<!DOCTYPE html>
<html>
<head>
<title>window.location</title>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<style type="text/css">
#view {
background:#FFC;
padding: 10px;
@h4
h4 / animated.box.html
Created April 3, 2012 13:09
Анимированый блок
<!DOCTYPE html>
<html>
<head>
<title>Анимированный блок</title>
<style>
#box {
height: 50px;
width: 100px;
background: #F00;
position: absolute;
@h4
h4 / location.html
Created April 3, 2012 14:59
Итог задания 05.2
<!DOCTYPE html>
<html>
<head>
<title>window.location</title>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<style type="text/css">
#view {
background:#FFC;
padding: 10px;
@h4
h4 / animated.box.1.html
Created April 3, 2012 16:02
Итог задания 05.3
<!DOCTYPE html>
<html>
<head>
<title>Анимированный блок</title>
<style>
#box {
height: 50px;
width: 100px;
background: #F00;
position: absolute;
@h4
h4 / classFunc.js
Created April 5, 2012 12:44
Функции для работы с именами классов
/*
* Служебные функции для работы с css-классами
* принимают ссылку на элемент странцы и строковое имя класса
*/
// Добавление класса к объекту
function addClass(el, cls) {
var c = el.className.split(' ');
@h4
h4 / random.bg.html
Created April 5, 2012 16:20
Случайны цвет фона
<html>
<head>
<title>Случайный цвет фона</title>
<script>
var colors = ['red', 'green', 'blue'];
function init() {
var num = Math.floor(Math.random() * colors.length);
@h4
h4 / cookie.js
Created April 10, 2012 13:13
Работа с cookie
@h4
h4 / validate.js
Created April 10, 2012 13:15
Функция валидации из книги Фленагана
/**
* David Flanagan
* JavaScript. The Definitive Guide
* Chapter 18.4
*/
/**
* Validate.js: unobtrusive HTML form validation.
*
* On document load, this module scans the document for HTML forms and