Permalink
Browse files

Making JSLint happy with recommended options

  • Loading branch information...
1 parent b297803 commit 58288272c3470906391342c1d23c42a17af494ed @NeilCrosby committed Mar 22, 2009
Showing with 13 additions and 11 deletions.
  1. +13 −11 hoffify.js
View
@@ -1,24 +1,26 @@
-hoffify_add = function() {
- var file = hoff_data[Math.ceil(Math.random()*hoff_data.length) - 1];
+/*global document, window, hoff_data */
+
+var hoffify_add = function () {
+ var file = hoff_data[Math.ceil(Math.random() * hoff_data.length) - 1];
var div = document.createElement('div');
div.style.position = 'fixed';
- var height = Math.random()*.9;
- if (typeof(window.innerHeight) == 'number') {
- height = height*window.innerHeight+'px';
- } else if(document.documentElement && document.documentElement.clientHeight) {
- height = height*document.documentElement.clientHeight+'px';
+ var height = Math.random() * 0.9;
+ if (typeof(window.innerHeight) === 'number') {
+ height = height * window.innerHeight + 'px';
+ } else if (document.documentElement && document.documentElement.clientHeight) {
+ height = height * document.documentElement.clientHeight + 'px';
} else {
- height = height*100+'%';
+ height = height * 100 + '%';
}
div.style.top = height;
- div.style.left = Math.random()*90 + '%';
+ div.style.left = Math.random() * 90 + '%';
div.style.zIndex = 10;
var img = document.createElement('img');
- img.setAttribute('src',file);
+ img.setAttribute('src', file);
var body = document.getElementsByTagName('body')[0];
body.appendChild(div);
div.appendChild(img);
-}
+};

0 comments on commit 5828827

Please sign in to comment.