浏览代码

Merge branch 'fix-callback-with-shared-dir' of https://github.com/hashar/reveal.js

Hakim El Hattab 12 年之前
父节点
当前提交
ad54b07a84
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 2 0
      README.md
  2. 1 1
      js/reveal.js

+ 2 - 0
README.md

@@ -179,6 +179,8 @@ Reveal.addEventListener( 'ready', function( event ) {
 
 
 An 'slidechanged' event is fired each time the slide is changed (regardless of state). The event object holds the index values of the current slide as well as a reference to the previous and current slide HTML nodes.
 An 'slidechanged' event is fired each time the slide is changed (regardless of state). The event object holds the index values of the current slide as well as a reference to the previous and current slide HTML nodes.
 
 
+Some libraries, like MathJax (see [#226](https://github.com/hakimel/reveal.js/issues/226#issuecomment-10261609)), get confused by the transforms and display states of slides. Often times, this can be fixed by calling their update or render function from this callback.
+
 ```javascript
 ```javascript
 Reveal.addEventListener( 'slidechanged', function( event ) {
 Reveal.addEventListener( 'slidechanged', function( event ) {
 	// event.previousSlide, event.currentSlide, event.indexh, event.indexv
 	// event.previousSlide, event.currentSlide, event.indexh, event.indexv

+ 1 - 1
js/reveal.js

@@ -232,7 +232,7 @@ var Reveal = (function(){
 
 
 				// Extension may contain callback functions
 				// Extension may contain callback functions
 				if( typeof s.callback === 'function' ) {
 				if( typeof s.callback === 'function' ) {
-					head.ready( s.src.match( /([\w\d_\-]*)\.?js|[^\\\/]*$/i )[0], s.callback );
+					head.ready( s.src.match( /([\w\d_\-]*)\.?js$|[^\\\/]*$/i )[0], s.callback );
 				}
 				}
 			}
 			}
 		}
 		}