浏览代码

Rescued view source button.

Mr.doob 11 年之前
父节点
当前提交
f08f07df8b
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      examples/index.html

+ 3 - 3
examples/index.html

@@ -75,7 +75,7 @@
 
 
 			#button {
 			#button {
 				position: fixed;
 				position: fixed;
-				bottom: 20px;
+				top: 20px;
 				right: 20px;
 				right: 20px;
 				padding: 8px;
 				padding: 8px;
 				color: #fff;
 				color: #fff;
@@ -351,13 +351,13 @@
 
 
 		var button = document.createElement( 'div' );
 		var button = document.createElement( 'div' );
 		button.id = 'button';
 		button.id = 'button';
-		button.textContent = '#';
+		button.textContent = 'View source';
 		button.addEventListener( 'click', function ( event ) {
 		button.addEventListener( 'click', function ( event ) {
 
 
 			var array = location.href.split( '/' );
 			var array = location.href.split( '/' );
 			array.pop();
 			array.pop();
 
 
-			window.open( array.join( '/' ) + '/' + selected + '.html' );
+			window.open( 'view-source:' + array.join( '/' ) + '/' + selected + '.html' );
 
 
 		}, false );
 		}, false );
 		button.style.display = 'none';
 		button.style.display = 'none';