Skip to content
Browse files

Javascript slide number

  • Loading branch information...
1 parent 27f4012 commit 2fe2404d6fcbc98058afdb3b3a6872351edd0b4a @BenoitZugmeyer committed
Showing with 6 additions and 8 deletions.
  1. +2 −0 index.html
  2. +1 −7 slideshow.css
  3. +2 −0 slideshow.js
  4. +1 −1 theme.css
View
2 index.html
@@ -211,6 +211,8 @@
</ul>
</footer>
+<p class="slide-number"></p>
+
<script src="slideshow.js"></script>
<script src="plugins/css-prefix.js"></script>
<script src="plugins/css-edit.js"></script>
View
8 slideshow.css
@@ -9,10 +9,8 @@ html, body {
}
body {
- counter-reset: slide;
margin: 0;
}
-
.slide {
display: none;
position:absolute;
@@ -30,8 +28,6 @@ body {
width:0;
overflow:hidden;
- counter-increment: slide;
-
-webkit-transition:1s opacity, 1s -webkit-transform;
-moz-transition:1s opacity, 1s -moz-transform;
-o-transition:1s opacity, 1s -o-transform;
@@ -56,8 +52,7 @@ body {
/**
* Slide number
*/
-.slide:target::before {
- content: counter(slide);
+.slide-number {
position: absolute;
top: .05in;
right: .5em;
@@ -79,7 +74,6 @@ body {
-webkit-border-radius: 999px;
border-radius: 999px;
}
-
/* If there's nothing selected, show the first */
.slide:first-child {
z-index:2;
View
2 slideshow.js
@@ -349,6 +349,8 @@ self.prototype = {
this.adjustFontSize();
+ $('.slide-number').textContent = this.slide + 1;
+
// Update items collection
this.items = $$('.delayed, .delayed-children > *', this.slides[this.slide]);
this.item = 0;
View
2 theme.css
@@ -106,7 +106,7 @@ pre strong {
border:30px solid transparent;
}
-.slide:target::before {
+.slide-number {
background: rgba(255, 255, 255, .6);
color: black;
text-shadow: .03em .03em .1em white;

0 comments on commit 2fe2404

Please sign in to comment.
Something went wrong with that request. Please try again.