SkillAgentSearch skills...

Pano

jQuery plugin to display a 360 degree panoramic image

Install / Use

/learn @seancoyne/Pano
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

pano

Build Status

jQuery plugin to display a 360 degree panoramic image

Requires

This plugin has been tested against jQuery 3.4.1. It should support other 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.

$(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.

View on GitHub
GitHub Stars51
CategoryDevelopment
Updated3y ago
Forks19

Languages

JavaScript

Security Score

80/100

Audited on Mar 5, 2023

No findings