Git Product home page Git Product logo

destaque's Introduction

Destaque

Destaque is a simple slideshow plugin with built-in parallax effect.

Refer to the jQuery Destaque website for examples.

Browser Compatibility

  • IE 7+
  • Firefox 3.6+
  • Chrome 4+
  • Safari 5+
  • Opera 10.10+

Dependencies

Usage

$("#slide-container").destaque({
  itemSelector: ".item",
  itemBackgroundSelector: ".background",
  itemForegroundElementSelector: ".foreground .element",
  controlsSelector: "#slide-pagination a"
});

Now the HTML:

<div id="slide-container">
  <div class="item">
    <div class="background">
      <img src="background-img.jpg"/>
    </div>

    <div class="foreground">
      <div class="element">Text 1</div>
      <div class="element">Text 2</div>
      <div class="element">Text 3</div>
    </div>
  </div>

  <div class="item">
    <div class="background">
      <img src="background-img.jpg"/>
    </div>

    <div class="foreground">
      <div class="element">Text 1</div>
      <div class="element">Text 2</div>
      <div class="element">Text 3</div>
    </div>
  </div>

  <div class="item">
    <!-- ... -->
  </div>
</div>

<p id="slide-pagination">
  <a href="#" rel="prev">Previous</a> - <a href="#" rel="next">Next</a>
</p>

Plugin Initialization

Callbacks

  • onInit(instanceOfDestaque): Called right after the plugin initialization.
  • onResize(instanceOfDestaque): Called when the window is resized.
  • onPause(instanceOfDestaque): Called after the automatic slide switching is paused.
  • onResume(instanceOfDestaque): Called after the automatic slide switching is resumed.
  • onSlideLoad(instanceOfDestaque, item, index): Called after a slide is loaded.
  • beforePageUpdate(instanceOfDestaque, pageData): Called before slide pagination. ex: pageData = {currentSlide: 0, totalSlides: 10}
  • onPageUpdate(instanceOfDestaque, pageData): Called after slide pagination.

Options

  • currentSlide (default: 0): First slide to be active.
  • slideSpeed (default: 1000): Transition speed of slides.
  • slideMovement (default: 150): Amount of space the current slide shifts, in pixels, when switching to the next slide.
  • slideDirection (default: "toLeft"): Direction in which the slides shift to.
  • elementSpeed (default: 1000): Transition speed of foreground elements.
  • autoSlideDelay (default: 3000): Automatic slide switching delay.
  • resumeSlideDelay (default: 250): Minimum delay before the automatic slide switching starts after being paused.
  • stopOnMouseOver (default: true): Pauses automatic slide switching when the mouse is over the container.
  • easingType (default: "easeInOutExpo"): Easing type used in slide and foreground elements transitions.
  • itemDefaultZIndex (default: 10): Z-index assigned to each slide.
  • itemSelector (default: "div.item"): CSS selector used to find each slide.
  • itemLoadedClass (default: "loaded"): CSS calss added right after a slide is loaded.
  • activeItemClass (default: "active"): CSS class added to the active slide.
  • itemBackgroundSelector (default: ".background img"): CSS selector used to find the background element of a slide.
  • itemForegroundElementSelector (default: ".foreground img"): CSS selector used to find each foreground element withing a slide.
  • controlsSelector (default: undefined): CSS selector used to find the pagination links.

Methods

  • pause(): Pauses the slideshow until a mouseover happens or resume is called
  • resume(): Resumes the slideshow
  • restart(): Sends the slideshow to the first page
  • goTo(index): Sends the slideshow to the given page, starts with 0.
  • refresh(paramsToOverride): Overrides some params and recalculates. Keeps the current page. Used for adaptative layouts.
  • slideSetAndMove(direction): Changes the slide direction. Does not work if the slide is animating. The possible values are "toLeft" or "toRight".

Destaque Queue

Makes jquery.destaque work enhanced for more than one instance in a page

Refer to the jQuery Destaque website for examples.

Usage

$('.triple-slides').destaquesQueue({
  delay: 250,
  itemSelector: ".item-triple",
  itemBackgroundSelector: ".background-triple",
  itemForegroundElementSelector: ".foreground-triple .element",
  controlsSelector: "#slide-pagination a"
});

Now the HTML:

<div class="triple-slides">
  <div class="item-triple">
    <div class="background-triple"></div>

    <div class="foreground-triple">
      <div class="element">Text 1</div>
    </div>
  </div>
  <!-- the same markup for other itens -->
</div>

<div class="triple-slides">
  <div class="item-triple">
    <div class="background-triple"></div>
    <div class="foreground-triple">
      <div class="element">Text 2</div>
    </div>
  </div>
  <!-- the same markup for other itens -->
</div>

<div class="triple-slides">
  <div class="item-triple">
    <div class="background-triple"></div>
    <div class="foreground-triple">
      <div class="element">Text 3</div>
    </div>
  </div>
  <!-- the same markup for other itens -->
</div>

<p id="slide-pagination">
  <a href="#" rel="prev">Previous</a> - <a href="#" rel="next">Next</a>
</p>

Plugin Initialization

Callbacks

Same as destaque

Options

Same as destaque with:

  • delay (default: 250): Delay between destaques.

Methods

Same as destaque with:

  • pauseFor(index)
  • resumeFor(index)
  • goToFor(index, slideNumber)
  • refreshFor(index, paramsToOverride)
  • slideSetAndMoveFor(index, direction)

Authors

License

Copyright (c) 2012 Globo.com - Webmedia. See COPYING for more details.

destaque's People

Contributors

alexanmtz avatar danielfm avatar davidsonfellipe avatar

Stargazers

 avatar

Watchers

 avatar  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.