templates/s6/jquery.slideshow.js in slideshow-0.9.6 vs templates/s6/jquery.slideshow.js in slideshow-0.9.7
- old
+ new
@@ -15,10 +15,20 @@
/***********************
* sample custom transition using scrollUp effect
* inspired by Karl Swedberg's Scroll Up Headline Reader jQuery Tutorial[1]
* [1] http://docs.jquery.com/Tutorials:Scroll_Up_Headline_Reader
*/
+
+function transitionSlideUpSlideDown( $from, $to ) {
+ $from.slideUp( 500, function() { $to.slideDown( 1000 ); } );
+}
+
+function transitionFadeOutFadeIn( $from, $to ) {
+ $from.fadeOut( 500 );
+ $to.fadeIn( 500 );
+}
+
function transitionScrollUp( $from, $to ) {
var cheight = $from.outerHeight();
// hide scrollbar during animation
$( 'body' ).css( 'overflow-y', 'hidden' );
@@ -76,26 +86,20 @@
}
}
function updateCurrentSlideCounter()
{
- $( '#currentSlide' ).html( '<a id="plink" href="">'
- + '<span id="csHere">' + settings.snum + '<\/span> '
- + '<span id="csSep">\/<\/span> '
- + '<span id="csTotal">' + settings.smax + '<\/span>'
- + '<\/a>' );
+ $( '#currentSlide' ).html( settings.snum + '/' + settings.smax );
}
function updateJumpList()
{
$('#jumplist').get(0).selectedIndex = (settings.snum-1);
}
function updatePermaLink()
{
- $('#plink').get(0).href = window.location.pathname + '#slide' + settings.snum;
-
// todo: unify hash marks??; use #1 for div ids instead of #slide1?
window.location.hash = '#'+settings.snum;
}
function goTo( target )
@@ -227,11 +231,18 @@
});
}
function createControls()
{
+ // todo: make layout into an id (not class?)
+ // do we need or allow more than one element?
+
+ // if no div.layout exists, create one
+ if( $( '.layout' ).length == 0 )
+ $( "<div class='layout'></div>").appendTo( 'body' );
+
$( '.layout' )
.append( "<div id='controls'>" )
.append( "<div id='currentSlide'>" );
var $controls = $( '#controls' )
@@ -252,11 +263,17 @@
populateJumpList();
updateCurrentSlideCounter();
updatePermaLink();
}
-
+
+ function toggleSlideNumber()
+ {
+ // toggle slide number/counter
+ $( '#currentSlide' ).toggle();
+ }
+
function toggleFooter()
{
$( '#footer').toggle();
}
@@ -266,11 +283,11 @@
if (!key) {
key = event;
key.which = key.keyCode;
}
if (key.which == 84) {
- toggle();
+ toggle(); // toggle between project and screen css media mode
return;
}
if( settings.isProjection ) {
switch (key.which) {
case 32: // spacebar
@@ -301,20 +318,26 @@
break;
case 35: // end
goTo(settings.smax);
break;
case 67: // c
- showHide('c');
+ showHide('c'); // toggle controls (navlinks,navlist)
break;
case 65: //a
case 80: //p
case 83: //s
toggleAutoplay();
break;
case 70: //f
toggleFooter();
break;
+ case 78: // n
+ toggleSlideNumber();
+ break;
+ case 68: // d
+ toggleDebug();
+ break;
}
}
}
function autoplay()
@@ -334,10 +357,37 @@
else {
subgo(1);
}
}
+function toggleDebug()
+{
+ settings.debug = !settings.debug;
+ doDebug();
+}
+
+function doDebug()
+{
+ // fix/todo: save background into oldbackground
+ // so we can restore later
+
+ if( settings.debug == true )
+ {
+ $( '#header' ).css( 'background', '#FCC' );
+ $( '#footer' ).css( 'background', '#CCF' );
+ $( '#controls' ).css( 'background', '#BBD' );
+ $( '#currentSlide' ).css( 'background', '#FFC' );
+ }
+ else
+ {
+ $( '#header' ).css( 'background', 'transparent' );
+ $( '#footer' ).css( 'background', 'transparent' );
+ $( '#controls' ).css( 'background', 'transparent' );
+ $( '#currentSlide' ).css( 'background', 'transparent' );
+ }
+}
+
function toggleAutoplay()
{
if( settings.autoplayInterval )
{
@@ -450,17 +500,13 @@
if( settings.mode == 'outline' )
toggle();
else if( settings.mode == 'autoplay' )
toggleAutoplay();
-
+
+
if( settings.debug == true )
- {
- $( '#header' ).css( 'background', '#FCC' );
- $( '#footer' ).css( 'background', '#CCF' );
- $( '#controls' ).css( 'background', '#BBD' );
- $( '#currentSlide' ).css( 'background', '#FFC' );
- }
+ doDebug();
document.onkeyup = keys;
} // end Slideshow