Browse Source

Cleaner code.

Mr.doob 12 năm trước cách đây
mục cha
commit
015b3c957a
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 3 2
      examples/index.html

+ 3 - 2
examples/index.html

@@ -396,8 +396,7 @@
 
 			if ( selected !== null ) divs[ selected ].className = 'link';
 
-			selected = file;
-			divs[ selected ].className = 'link selected';
+			divs[ file ].className = 'link selected';
 
 			window.location.hash = file;
 			viewer.src = file + '.html';
@@ -405,6 +404,8 @@
 
 			button.style.display = '';
 
+			selected = file;
+
 		};
 
 		if ( window.location.hash !== '' ) {