Code Monkey home page Code Monkey logo

pano's Introduction

pano

Build Status

jQuery plugin to display a 360 degree panoramic image

Requires

This plugin has been tested against jQuery 1.8.3. It should support newer versions but they have not been tested.

Options

  • img - The URL to the background image. This should be a 360 degree panoramic image. You should set the CSS so that the width and height of the containing block are your desired size.
  • interval - How often to trigger the move command when the user holds down the mouse button, touch or if you call the moveLeft or moveRight API methods. (Default 100ms)
  • speed - How fast should the animation move? (Default 50ms)

It will add a class of .moving whenever the background image is being moved (whether drag & drop or via the controls).

API

The plugin returns a public API with 3 methods:

  • moveLeft(interval, speed) - Starts moving the image to the left at the indicated interval and speed. If the arguments are not provided, it will use the defaults.
  • moveRight(interval, speed) - Starts moving the image to the right at the indicated interval and speed. If the arguments are not provided, it will use the defaults.
  • stopMoving() - Stops all motion.

Example

See https://seancoyne.github.io/pano for working example.

$(document).ready(function(){
	var pano = $("#myPano").pano({
		img: "/path/to/image.jpg",
		interval: 100,
		speed: 50
	});
	
	pano.moveLeft();
	pano.stopMoving();
	pano.moveRight();
	pano.stopMoving();
	
});

Other Usage

The plugin supports the CommonJS module system so you can require it using npm and bundle via Browserify.

pano's People

Contributors

seancoyne avatar

Watchers

Helmar Fantilanan 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.