Javascript
1var img01 = {
2 url : [['01.png'],['02.png'],['03.png'],['04.png'],['05.png']],
3 shuffle : function() {
4 for (i = this.url.length; i > 0; --i) {
5 tmp = this.url[p = Math.floor(Math.random()*i)];
6 this.url[p] = this.url[i-1] ;
7 this.url[i-1] = tmp ;
8 }
9 },
10 p : 0,
11 put : function() {
12 document.write('<img src="'+this.url[this.p++][0]+'" />');
13 if (this.p >= this.url.length)
14 this.p = 0;
15 }
16};
17img01.shuffle();
18```提供していただいたコードを貼り付けます。
19
20IE11、Firefox、Chrome、Edgeでやってみましたが、ちゃんとtop、leftとも効いています。
21html内のscriptタグの`img.put()`は`img01.put()`の間違いですよね?