浏览代码

support moz and webkit prefixed requestAnimationFrame

Hakim El Hattab 11 年之前
父节点
当前提交
29c5af84be
共有 2 个文件被更改,包括 6 次插入5 次删除
  1. 5 4
      js/reveal.js
  2. 1 1
      js/reveal.min.js

+ 5 - 4
js/reveal.js

@@ -221,7 +221,8 @@ var Reveal = (function(){
 								'OTransform' in document.body.style ||
 								'OTransform' in document.body.style ||
 								'transform' in document.body.style;
 								'transform' in document.body.style;
 
 
-		features.requestAnimationFrame = typeof window.requestAnimationFrame === 'function';
+		features.requestAnimationFrameMethod = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;
+		features.requestAnimationFrame = typeof features.requestAnimationFrameMethod === 'function';
 
 
 		features.canvas = !!document.createElement( 'canvas' ).getContext;
 		features.canvas = !!document.createElement( 'canvas' ).getContext;
 
 
@@ -2866,7 +2867,7 @@ var Reveal = (function(){
 		this.render();
 		this.render();
 
 
 		if( this.playing ) {
 		if( this.playing ) {
-			window.requestAnimationFrame( this.animate.bind( this ) );
+			features.requestAnimationFrameMethod.call( window, this.animate.bind( this ) );
 		}
 		}
 
 
 	};
 	};
@@ -2890,8 +2891,8 @@ var Reveal = (function(){
 
 
 		// Solid background color
 		// Solid background color
 		this.context.beginPath();
 		this.context.beginPath();
-		this.context.arc( x, y, radius, 0, Math.PI * 2, false );
-		this.context.fillStyle = 'rgba(0,0,0,0.2)';
+		this.context.arc( x, y, radius + 2, 0, Math.PI * 2, false );
+		this.context.fillStyle = 'rgba( 0, 0, 0, 0.4 )';
 		this.context.fill();
 		this.context.fill();
 
 
 		// Draw progress track
 		// Draw progress track

文件差异内容过多而无法显示
+ 1 - 1
js/reveal.min.js


部分文件因为文件数量过多而无法显示