GithubHelp home page GithubHelp logo

3dmusic / jqueryfullscreencycler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nbunney/jqueryfullscreencycler

0.0 0.0 0.0 337 KB

A JQuery plugin that creates a fullscreen image cycler.

License: GNU General Public License v2.0

JavaScript 100.00%

jqueryfullscreencycler's Introduction

jQueryFullscreenCycler

jQueryFullscreenCycler is a super lightweight jQuery plugin for creating fullscreen image cyclers. The plugin is chainable with other jQuery commands and is careful to make sure that images are loaded before they are shown.

Features

  • Lightweight. Under 3K minified.
  • Responsive. Uses CSS3 to make sure that the images correctly cover the screen no matter what the size or orientation.
  • Careful. Verifies that images are loaded before fading them in. We assume that you will be using large images for page backgrounds so we are careful to only cycle to an image if we can be sure that it is loaded fully so that visitors with slower connections will not see a series of partly loaded images the first trip through.
  • SEO and Memory footprint aware. The plugin does not load the images until after the DOM is loaded allowing Google and Bing to see a fast page load time. To keep the memory footprint small we only have two images loaded in the DOM at any time. The others should be cached in the browser so that they load rapidly when requested again.
  • Options. We allow a single image to be used which will not fire the cycler code but will just create the CSS for the background image. Speed of cycle and speed of fade are also options along with the background color to show while the first image is loading as well as the max number of times to cycle.

Usage

  1. Add a div to your design. We suggest adding this just under the body tag of your page.
<div id="fsCycler"></div>
  1. Include jQuery.
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
  1. Include jQueryFullscreenCycler.
<script type="text/javascript" src="../src/jquery.fullscreenCycler.js"></script>
  1. Create an array for the images you want to show.
var i = new Array("http://lorempixel.com/1440/900/nature/1","http://lorempixel.com/1440/900/nature/2","http://lorempixel.com/1440/900/nature/3","http://lorempixel.com/1440/900/nature/4");
  1. Call jQueryFullscreenCycler for the div you added passing in the image array.
<script language="javascript" type="text/javascript">
  (function($) {
    $('#fsCycler').fullscreenSlider({images: i});
  })(jQuery);
</script>

Options

jQueryFullscreenCycler has five optional parameters that can be passed to the plugin. Example:

$('#fsCycler').fullscreenSlider({
  images: i,
  speed: 6.5, 
  maxCycles: 4,
  transition: "slide right"
  transitionSpeed: 2, 
  backgroundColor: "transparent"
});

#####speed
The time (in seconds) spent displaying each image (you can use decimals to get more exact times on the cycles).

default: '6'
options: integer

#####maxCycles Max number of cycles before going back to the first image

default: '0' // Infinite cycles
options: integer

#####transitionSpeed The time (in seconds) spent fading between images

default: 6
options: integer

#####backgroundColor
The background color that will be shown before the first image is shown

default: transparent
options: CSS background color

#####transition Transition type

default: fade
options: transition type

####Transitions Currently, there are only two transitions, slide and fade.
fade can be called like this:

transition: "fade"

There are no extra parameters for fade.

slide has one required parameter. You must specify a direction. Example:

transition: "slide right"

slide accepts top, bottom, right, and left as directions.

jqueryfullscreencycler's People

Contributors

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