Git Product home page Git Product logo

presenter.js's Introduction

Presenter.js

Simple jQuery plugin for presenting a basic vertical slideshow. The slideshow can be controlled with up / down arrow keys or page up / down keys. Check out the demo.

Installation

You'll want to grab these files:

  • presenter.min.js
  • styles/presenter.css
  • images/keyboard-image.png

Add the presenter.css stylesheet to your <head>

<link rel="stylesheet" media="screen" href="styles/presenter.css">

If you require the keyboard hint image, place it in your images folder. If you'd like to customize the location, you can pass a string with the file location as an option. See usage for more info.

Include jQuery 1.7+ and then presenter.min.js at the bottom of your document.

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="presenter.min.js"></script>

Presenter.css

Provides styling for the slides, really basic responsive styles and styles for the keyboard hint. You can replace keyboard-image.png with whatever you like or disable the feature altogether. See usage for more info.

Usage

The most basic usage is calling presenter like so:

$(function() {
  $('body').presenter()
})

You can customize several options. These are the defaults:

$(function() {
  $('body').presenter({
    selector: '.slide',                      // The container element for your slides
    contentSelector: '.slide-content',       // The element wrapping your content
    showHint: true,                          // Whether or not to show the keyboard image hint
    hintSource: 'images/keyboard-image.png'  // The location of the hint image
  })
})

Advanced Usage

Presenter.js will trigger an event presenter.active on whatever slide came into view. Additionally, presenter.js will add a class to each slide which starts with “slide-” and followed by the slide's position like so: slide-1, slide-2 and so on.

So together you can do something like this:

$(function() {
  $('body').presenter()

  $('.slide-1').on('presenter.active', function() {
    console.log('Hello!')
  })
})

License

Distributed under MIT License

Note This project makes use of resizeend written by Dominik Porada which is also distributed under the MIT License.

@fabrahamlincoln

presenter.js's People

Contributors

fabianperez avatar

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.