This project is read-only.

Does Slide.Show support random transitions?

Dec 18, 2007 at 7:21 PM
Edited Dec 18, 2007 at 8:03 PM
Need help,
1. Where can I set randomize transition between pictures for this great control?
2. How to enable progressbar when first load the page (I have quite a few albums).
Dec 18, 2007 at 10:33 PM
Edited Dec 19, 2007 at 8:17 AM

mpimsarn wrote:
1. Where can I set randomize transition between pictures for this great control?
2. How to enable progressbar when first load the page (I have quite a few albums).

Although these are both great suggestions, neither of these features made it into the current version of Slide.Show. I'd encourage you to add these feature requests to our Issue Tracker.

The good news is that Slide.Show is free and open source. We are very interested in adding contributors to this project so that these great ideas can be implemented and released quickly. Interested? Eventually, I'd imagine both of your suggestions will make it into an upcoming release sooner or later.

Please let us know if you have any more suggestions, questions, or contributions. Thanks!
Feb 29, 2008 at 6:20 AM
Edited Feb 29, 2008 at 6:35 AM
Hi, I managed to get Random Transitions going for the xmlDataProvider by doing the following.:

In your Configuration XML list all the transitions you would like to use:


Configuration.xml
----------------------------
<transitions>
<transition type="FadeTransition" name="CrossFadeTransition" />
<transition type="ShapeTransition" name="CircleOutTransition" />
<transition type="SlideTransition" name="SlideLeftTransition" />
<transition type="SlideTransition" name="SlideDownTransition">
<option name="direction" value="Down" />
</transition>
<transition type="WipeTransition" name="WipeRightTransition">
<option name="direction" value="Right" />
</transition>
</transitions>
----------------------


In yor Data.xml add a ' transitions="random" ' attribute to the Data element

<data startalbumindex="0" transition="random">

Then in the SlideShow.js file make the following changes to ' getSlideTransitionData '

getSlideTransitionData: function(albumIndex, slideIndex)
{
/// <summary>Gets the transition data for a slide.</summary>
/// <param name="albumIndex">The album index.</param>
/// <param name="slideIndex">The slide index.</param>
/// <returns>The transition data.</returns>

var transitionName;

if (!this.transitions)
this.transitions = { notransition: { type: "NoTransition" } };

var maxTransitions = this.options.transitions.transition.length;

if( maxTransitions && this.data.transition.toLowerCase() == "random" )
{
var randomNumber = Math.floor(Math.random() * maxTransitions);
transitionName = this.options.transitions.transition[randomNumber].name;
}
else
{
if (this.isSlideIndexValid(albumIndex, slideIndex))
transitionName = this.data.album[albumIndex].slide[slideIndex].transition;

if (!transitionName && this.isAlbumIndexValid(albumIndex))
transitionName = this.data.album[albumIndex].transition;

if (!transitionName && this.data)
transitionName = this.data.transition;

if (!transitionName)
transitionName = "NoTransition";
}

var key = transitionName.toLowerCase();
var transition = this.transitions[key];

if (!transition)
{
for (var i = 0, j = this.options.transitions.transition.length; i < j; i++)
{
if (this.options.transitions.transition[i].name.toLowerCase() == key)
{
transition = this.options.transitions.transition[i];
break;
}
}

if (transition)
this.transitions[key] = transition;
else
throw new Error("Invalid transition: " + transitionName);
}

return transition;
},


Mar 3, 2008 at 1:25 AM
Nice work. I'm going to add this to the code base
Mar 3, 2008 at 1:25 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.