소스 검색

helper method for retrieving slide based on index (closes #293)

Hakim El Hattab 12 년 전
부모
커밋
11fc906add
2개의 변경된 파일13개의 추가작업 그리고 1개의 파일을 삭제
  1. 12 0
      js/reveal.js
  2. 1 1
      js/reveal.min.js

+ 12 - 0
js/reveal.js

@@ -1829,6 +1829,18 @@ var Reveal = (function(){
 		// Returns the indices of the current, or specified, slide
 		getIndices: getIndices,
 
+		// Returns the slide at the specified index, y is optional
+		getSlide: function( x, y ) {
+			var horizontalSlide = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR )[ x ];
+			var verticalSlides = horizontalSlide && horizontalSlide.querySelectorAll( 'section' );
+
+			if( typeof y !== 'undefined' ) {
+				return verticalSlides ? verticalSlides[ y ] : undefined;
+			}
+
+			return horizontalSlide;
+		},
+
 		// Returns the previous slide element, may be null
 		getPreviousSlide: function() {
 			return previousSlide;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
js/reveal.min.js


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.