Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added 'goTo' method in MooViewer

  • Loading branch information...
commit 03490727fa3993034aaeb4282f6ffbb2c3b6f0e7 1 parent 7821805
@samuelbirch samuelbirch authored
Showing with 18 additions and 1 deletion.
  1. +18 −1 Source/Interface/MooViewer.js
View
19 Source/Interface/MooViewer.js
@@ -32,7 +32,7 @@ var MooViewer = new Class({
nav: true,
buttons: true,
fadeText: true,
- transition: 'sine:out',
+ transition: 'sine:out', //fade
duration: .25,
wait: 3,
backFade: false,
@@ -50,6 +50,10 @@ var MooViewer = new Class({
this.descriptions = this.viewer.getElements('div.desc').dispose();
this.titles = this.viewer.getElements('h2').dispose();
+ if(this.options.index){
+ this.items[0].destroy();
+ }
+
this.body = new Element('div', {'class':'body'}).wraps(this.itemsContainer);
this.fading = false;
@@ -165,6 +169,19 @@ var MooViewer = new Class({
}
},
+ goTo: function(index){
+ if(!this.fading){
+ if(index >= this.items.length){
+ index = this.items.length-1;
+ }
+ if(index < 0){
+ index = 0;
+ }
+
+ this.goToItem(index);
+ }
+ },
+
play: function(){
this.playing = true;
this.timer = this.next.periodical(this.options.wait*1000, this);
Please sign in to comment.
Something went wrong with that request. Please try again.