Git Product home page Git Product logo

irslidescontroller's Introduction

irSlideshowController

There’s nothing to see here — yet. Move on. ;)

Miscellany

shouldStartSlideshow

initWithOptions({

	container: (jQuerySelectorstring) theContainer,	
	presets: (IRSlideshowPresets)
	
});





Nota

	per-photograph preset, e.g. better control over per-image transition
	
	global preset
	
	
	
	
	
	Ideally / a working idea is to make a default, global preset, and allow the user to specify both a custom global preset (a subset of available configurations) and a per-photograph preset that might override the global preference

// irSlidesController.initWithOptions({

	container: jQuerySelectorString

	slides: [{}, {}, {}, {}],
	
	layout: irSlideshowEngine.presets.layout.vertical,
	
	onSlideBlur: irSlidesController.presets.slideFocus.fadeOut,
	onSlideFocus: irSlidesController.presets.slideFocus.fadeIn,
	
	initializeImmediately: true

});

// fadeOut -> slide fades out

fadeIn -> slide fades in

and on each slide advancement / devancement we make sure that the container scrolls to the new slide (no scaling)

// Assumptions

the viewport is a giant plane and everything is laid on it.  there is NO MAGNIFICATION.  scaling the viewport should cause everything to be re-laid by calling `irSlideshowEngine.layoutSlidesIfNeeded`.
	




this.slides = [ ]

	{
	
		name: name
		manifestObject: (jQuery element reference)
		contextInfo: (anything)
	
	}








layoutSlides: function () {

//	Lays the slides out.  This function calls thisObject.layout on each slide passing the index of the slide with the engine (helps figure out the right dimensions when it comes to positioning), and an optional contextInfo so that a custom layout algorithm function can better figure out the right location.  The layout function must return a hash that conforms to { top: originTop, left: originLeft } so that the slide is resized correctly.

	$.each(this.slides, function (indexOfSlide, slideObject) {
	
		slideObject.manifestObject.stop(true, true);
		
		var originalSlidePosition = {
		
			"top": slideObject.manifestObject.position().top,
			"left": slideObject.manifestObject.position().left
		
		}
		
		var plausibleSlidePosition = thisObject.layout(indexOfSlide, thisObject, slideObject.contextInfo);
		
		var finalSlidePosition = {
		
			"top": parseFloat((plausibleSlidePosition && plausibleSlidePosition.top), 10) || originalSlidePosition.top,				
			"left": parseFloat((plausibleSlidePosition && plausibleSlidePosition.left), 10) || originalSlidePosition.left
		
		}
		
		slideObject.animate(thisObject.slideTransitionInterval, finalSlidePosition);
	
	});

}










IRSlidesControllerDelegate

one-way void slideWillAppear(inSlideController, inSlide)
one-way void slideDidAppear(inSlideController, inSlide)

one-way void slideWillDisappear(inSlideController, inSlide)
one-way void slideDidDisappear(inSlideController, inSlide)

Boolean slidesControllerShouldShowSlide(inSlideController, inSlide)





properties

IRSlidesControllerSlide currentSlide

	//	this property is a wrapper around thisObject.getCurrentSlide and thisObject.setCurrentSlide.

Boolean isPlaying





public methods

start
stop

IRSlidesControllerSlide getCurrentSlide
Boolean setCurrentSlide(theIndex, animated, stopsAfterTransition)

	//	We can’t really pass objects here because JavaScript does not have native object hashing.  animated defaults to true and stopsAfterTransition defaults to false.

irslidescontroller's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.