Created
August 12, 2011 04:55
-
-
Save postmodern/1141488 to your computer and use it in GitHub Desktop.
Convert Markdown slides (separated by ------------- dividers) into divs for slippy.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
var $slides = $("#slides"); | |
var $currentSlide = null; | |
function newSlide() { | |
$currentSlide = $('<div class="slide"></div>') | |
$currentSlide.appendTo($slides); | |
} | |
newSlide(); | |
$("#content > *").remove().each(function() { | |
if ($(this).is('hr')) { | |
newSlide(); | |
} | |
else | |
{ | |
$currentSlide.append(this); | |
} | |
}); | |
$("#slides > .slide").slippy({ | |
// settings go here | |
// possible values are: | |
// - animLen, duration for default animations (0 = disabled) | |
// - animInForward, receives a slide and animates it | |
// - animInRewind, receives a slide and animates it | |
// - animOutForward, receives a slide and animates it | |
// - animOutRewind, receives a slide and animates it | |
// - baseWidth, defines the base for img resizing, if you don't want only | |
// full-width images, specify this as the pixel width of a slide so that | |
// images are scaled properly (default is 620px wide) | |
// - ratio, defines the width/height ratio of the slides, defaults to 1.3 (620x476) | |
// - margin, the fraction of screen to use as slide margin, defaults to 0.15 | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment