Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
/* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */
2
 
3
function Grid(spacing, length) {
4
	this.spacing = spacing;
5
	this.length = length;
6
}
7
 
8
Grid.prototype.write = function() {
9
	var html = '';
10
	for (var i = 1; i <= (this.length / this.spacing); i++) {
11
		var num = i * this.spacing;
12
		html += '<span class="verticalgridline" style="left: ' + num + 'px;height: ' + this.length + 'px">' + num + '</span>';
13
		html += '<span class="horizontalgridline" style="top: ' + num + 'px;width: ' + this.length + 'px">' + num + '</span>';
14
	}
15
	document.write(html);
16
}