diff --git a/slideshow.css b/slideshow.css
index 3850575..af07ec5 100755
--- a/slideshow.css
+++ b/slideshow.css
@@ -11,9 +11,9 @@
.delayed,
.delayed-children > * {
transition:.5s;
- transition-property: transform, opacity, left, top, right, bottom, background;
+ transition-property: all;
}
-
+
/**
* Styles
*/
@@ -37,6 +37,8 @@
font-size:250%;
line-height:1.6;
+
+ opacity: 1;
}
.slide.previous,
@@ -45,6 +47,8 @@
display: block;
visibility: hidden;
overflow:hidden;
+
+ opacity: 0;
}
.slide:target {
@@ -84,11 +88,13 @@
.delayed,
.delayed-children > * {
opacity: 0;
+ transform: translateX(20px);
}
.delayed.displayed,
.delayed-children > .displayed {
opacity: .3;
+ transform: translateX(0);
}
.delayed.current,
@@ -99,6 +105,7 @@
.delayed-children > .displayed.persistent,
.delayed-children.persistent > .displayed {
opacity: 1;
+ transform: translateX(0);
}
/**
diff --git a/slideshow.js b/slideshow.js
index d81ffc5..51c4b86 100755
--- a/slideshow.js
+++ b/slideshow.js
@@ -1,7 +1,7 @@
-/**
- * CSSS javascript code
+/**
+ * CSSS javascript code
* @author Lea Verou (http://leaverou.me)
- * @version 2.0
+ * @version 2.0
*/
/**
@@ -23,15 +23,15 @@ if(!('classList' in body)) {
// Cache
element, we may need it for slides that don't have titles
var documentTitle = document.title + '';
-var self = window.SlideShow = function(slide) {
+var self = window.SlideShow = function(slide) {
var me = this;
// Set instance
if(!window.slideshow) {
window.slideshow = this;
- }
-
- // Current slide
+ }
+
+ // Current slide
this.index = this.slide = slide || 0;
// Current .delayed item in the slide
@@ -60,9 +60,9 @@ var self = window.SlideShow = function(slide) {
this.indicator = document.createElement('div');
this.indicator.id = 'indicator';
- body.appendChild(this.indicator);
-
- // Get the slide elements into an array
+ body.appendChild(this.indicator);
+
+ // Get the slide elements into an array
this.slides = $$('.slide', body);
// Get the overview
@@ -99,14 +99,14 @@ var self = window.SlideShow = function(slide) {
}
// Order of the slides
- this.order = [];
-
+ this.order = [];
+
for(var i=0; i 0) {
this.previousItem();
@@ -361,13 +361,13 @@ self.prototype = {
getSlideById: function(id) {
return $('.slide#' + id);
- },
+ },
/**
Go to an aribtary slide
@param which {String|Integer} Which slide (identifier or slide number)
- */
- goto: function(which) {
+ */
+ goto: function(which) {
var slide;
// We have to remove it to prevent multiple calls to goto messing up
@@ -380,18 +380,18 @@ self.prototype = {
// Argument is a valid slide number
this.index = which;
this.slide = this.order[which]
-
+
slide = this.slides[this.slide];
-
- location.hash = '#' + slide.id;
- }
- else if(which + '' === which) { // Argument is a slide id
- slide = this.getSlideById(which);
-
- if(slide) {
- this.slide = this.index = +slide.getAttribute('data-index');
+
+ location.hash = '#' + slide.id;
+ }
+ else if(which + '' === which) { // Argument is a slide id
+ slide = this.getSlideById(which);
+
+ if(slide) {
+ this.slide = this.index = +slide.getAttribute('data-index');
location.hash = '#' + which;
- }
+ }
}
if(slide) { // Slide actually changed, perform any other tasks needed
@@ -404,11 +404,11 @@ self.prototype = {
iframe.setAttribute('src', src);
}
}
- else {
+ else {
this.adjustFontSize();
}
- this.indicator.textContent = this.index + 1;
+ this.indicator.textContent = document.title +' - slide '+ (this.index + 1);
// Update items collection
this.items = $$('.delayed, .delayed-children > *', this.slides[this.slide]);
@@ -437,7 +437,7 @@ self.prototype = {
var me = this;
setTimeout(function() {
addEventListener('hashchange', me, false);
- }, 1000);
+ }, 1000);
},
gotoItem: function(which) {
@@ -520,7 +520,7 @@ self.prototype = {
}
return false;
- }
+ }
};
/**********************************************
@@ -536,8 +536,8 @@ self.getSlide = function(element) {
}
return slide;
-}
-
+}
+
})(document.head || document.getElementsByTagName('head')[0], document.body, document.documentElement);
// Rudimentary style[scoped] polyfill