浏览代码

control slide visibility through class instead of style

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

+ 5 - 1
css/reveal.css

@@ -616,6 +616,11 @@ body {
 						opacity 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
 }
 
+.reveal .slides>section.visible,
+.reveal .slides>section>section.visible {
+	display: block;
+}
+
 /* Global transition speed settings */
 .reveal[data-transition-speed="fast"] .slides section {
 	-webkit-transition-duration: 400ms;
@@ -652,7 +657,6 @@ body {
 
 .reveal .slides>section.present,
 .reveal .slides>section>section.present {
-	display: block;
 	z-index: 11;
 	opacity: 1;
 }

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


+ 2 - 2
js/reveal.js

@@ -1860,7 +1860,7 @@ var Reveal = (function(){
 				distanceX = Math.abs( ( indexh - x ) % ( horizontalSlidesLength - viewDistance ) ) || 0;
 
 				// Show the horizontal slide if it's within the view distance
-				horizontalSlide.style.display = distanceX > viewDistance ? 'none' : 'block';
+				horizontalSlide.classList[ distanceX > viewDistance ? 'remove' : 'add' ]( 'visible' );
 
 				if( verticalSlidesLength ) {
 
@@ -1871,7 +1871,7 @@ var Reveal = (function(){
 
 						distanceY = x === indexh ? Math.abs( indexv - y ) : Math.abs( y - oy );
 
-						verticalSlide.style.display = ( distanceX + distanceY ) > viewDistance ? 'none' : 'block';
+						verticalSlide.classList[ ( distanceX + distanceY ) > viewDistance ? 'remove' : 'add' ]( 'visible' );
 					}
 
 				}

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


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