فهرست منبع

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


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است