Giter Site home page Giter Site logo

threesixty-slider's Introduction

Hello All, I am not maintaining this plugin anymore.

Three Sixty Image slider plugin

Three Sixty Image slider plugin v2.0.5

Bitdeli Badge Build Status Gitter

This is a jQuery plugin to create 360 degree product image slider. The plugin is full customizable with number of options provided. The plugin have the power to display images in any angle 360 degrees. This feature can be used successfully in many use cases e.g. on an e-commerce site to help customers look products in detail, from any angle they desire.

Features

  • Smooth Animation
  • Plenty of option parameters for customization
  • Api interaction
  • Simple mouse interaction
  • Custom behavior tweaking
  • Support for touch devices
  • Easy to integrate
  • No flash
  • Plugin integration

Plugins

Installation

Git

git clone https://github.com/creativeaura/threesixty-slider.git

Or install using bower

bower install threesixty-slider

Example 1

Javascript

window.onload = init;

var product;
function init(){

    product1 = $('.product1').ThreeSixty({
        totalFrames: 72, // Total no. of image you have for 360 slider
        endFrame: 72, // end frame for the auto spin animation
        currentFrame: 1, // This the start frame for auto spin
        imgList: '.threesixty_images', // selector for image list
        progress: '.spinner', // selector to show the loading progress
        imagePath:'assets/product1/', // path of the image assets
        filePrefix: 'ipod-', // file prefix if any
        ext: '.jpg', // extention for the assets
        height: 265,
        width: 400,
        navigation: true,
        disableSpin: true // Default false
    });

}

HTML Snippet

<div class="threesixty product1">
    <div class="spinner">
        <span>0%</span>
    </div>
    <ol class="threesixty_images"></ol>
</div>

Here we are initializing an image slider for product 1. The ThreeSixty class constructor require a config object with properties like totalFrame, endFrame and currentFrame

Documentation

Methods

Public methods to control the slider after initialization.

Method NameDescription
.play()Function to trigger the auto rotation of the slider
.stop()Function to stop the auto play
.next()Function to move the slider to next frame
.previous()Function to move the slider to previous frame
.gotoAndPlay()Use this function if you want the slider spin to a particular frame with animation.
Config

Here are the list of config value you can pass in while you initilize your 360 slider.

ConfigDefault valueTypeDescription
totalFrames180NumberSet total number for frames used in the 360 rotation
currentFrame1NumberSet the starting from of the auto spin on initilize
endFrame180NumberSet the frame where you want the auto spin to stop
framerate60NumberFramerate for the spin animation
filePrefix''Stringfile prefiex for the assets if you assets name is nike_boot_1.png then filePrefix will be nike_boot_
extpngStringFile extension for all the assets
height300NumberHeight you want to set for the three sixty container
width300NumberWidth you want to set for the three sixty container
style{}ObjectObject container styles for the preloader similar to jQuery.css({})
navigationtrueBooleanSet false if you don't want default navigation controls
autoplayDirection1NumberControl the direction of the spin depending on your assets. You can use 1 or -1
dragtrueBooleanSet false if you want to disable mouse and touch events on the slider.
disableSpinfalseBooleanWill disable the initial spin on load
zeroPaddingfalseBooleantrue will add 0 padding for file names 1 - 9
responsivefalseBooleanEnable responsive width for 360
onReadyfunction() {}FunctionCallback triggers once all images are loaded and ready to render on the screen
playSpeed100NumberValue to control the speed (in milliseconds) of play button rotation
zeroBasedfalseBooleanZero based for image filenames starting at 0

Demo

Browsers Supported

Browsers Supported

This plugin is supported in all browsers including our beloved IE 6

Support

For support and question please contact at [email protected] or follow at @gauravjassal

LICENSE

Copyright 2013 Gaurav Jassal

Released under the MIT and GPL Licenses.

threesixty-slider's People

Contributors

arthuryeti avatar bitdeli-chef avatar bitstorm avatar creativeaura avatar gjassal-aimia avatar igloczek avatar olsonkr avatar rivol avatar simshanith avatar takeshionishi avatar waffle-iron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

threesixty-slider's Issues

Autoplay option

Does autoplay option (true) mean always spin? "autoplay: true" does nothing for me.

Safari 8 skips frames at end of sequence

As the slider reaches the final frames it seems to skip the last couple and glitch out.

I tested it in Chrome and Firefox and didn't experience the same problem.
I tested it with 10 frames, 30 frames, and 150 frames so I don't think it was an issue with the files being too large that could possibly be slowing down the browser.

Passing an array of image URLs alternatively to imagePath, filePrefix & ext to constructor

Would be great, if ThreeSixty was able not only to build it's image structure from class constructor options imagePage, filePrefix, (zeroPadding) and ext, but also had an option to pass the image URLs as an array.

I have lots of autogenerated image sets consisting of 36 single images with relatively big dimensions, and due to loading times only every second frame should be loaded (1, 3, 5, ...). Thats enough for a smooth transition between the frames and reduces loading time (and traffic of course on server and client side) by half.

As a plus, by passing an array of ready qualified URLs, one is also able to use images that are numbered with characters (A, B, C) or have an inconsistent naming scheme.

Best,
Alex.

Not working with latest jquery library

The slider seems not to work with latest jquery library. I got "Uncaught TypeError: Cannot read property 'msie' of undefined". Had to load in older version of jquery to make slider to work.

AppCongif

First of all, thank you for making this threesixty code into a jquery plugin.

I'm not sure if you noticed, but the AppConfig is misspelled "AppCongif". It's fine except it's spelled correctly/differently when getting playSpeed. For example, line 316 uses AppConfig.playSpeed and causes an undefined error.

Start spinning before all the images download ?

Is there any way to start with the spinning after a certain (x) amount of images are downloaded ?

For ex: I have 36 images and I want to start spinning the product after 12 are downloaded and as I spin it it continues to download the rest of the images.

Ipad bug with gotoAndPlay()

Hi there,
I'm having a problem when using gotoAndPlay() on ipad I get thousands of errors saying: Type error: Result of expression 'frames[theFrame]' [undefined] is not an object - and also - Result of expression 'frames[base.getNormalizedCurrentFrame()]' [undefined] is not an object.
Any idea what is causing this? Not working on IE8 too, probably because of the same thing.
Thank you!

Zoom functionality

Hello,

is it planned to add a zoom functionality to this script?

Regards,
Tobias

No Drag with Scrollbar on Android

Scrollbar doesn't like to be touched/held, then dragged. It's trying to scroll the page instead.

Android version 4.0.3
HTC Sense version 4.0

v2.0 responsive auto height does not fit original image proportion.

I've got my slider loaded on click which switches the div content from image to slider. Auto height calculation is off by 4px so I've had to add -4px margin to the initial image style.

Additionally either responsive mode should calculate the height initially during the load instead of defined height parameter or it should calculate proportions with this parameter.

Enable pinch-to-zoom on touch devices

if you try to pinch on slider the browser won't zoom.
This is because of e.preventDefault()
Usually

if (e.touches && e.touches.length > 1) {
    return;
}

at the beginning of touch listeners fixes the problem, after that you can securely preventDefault

Problem to Load/display 360-slider on click

Hi,

I really like your update of apple three sixty plugin!
It works really great!!

But I don't know how to display the 360-slider on click. On my page load, the 360-slider have css display: none. I would like to show it on button click (on click : css= display: block).
However nothing is displayed. I successed to load other jquery plugin with this kind of method but not three-sixty.

I don't know how to call the jquery. Or to refresh it. Is it possible?

Sorry for English, I'm French

Loic

Flickering bug in Opera 12

I've noticed an issue when using large images for 360 in Opera browser:
Opera flickers on each frame until all are loaded, then the animation
becomes smooth.

Bug exists in Opera 12

Images in question are 1600px x 600px and are about 200k each.

Trigger "ready" event

I can't catch ready event. Can you "fire" ready event after you call to showImages method

Slow down 'play' speed

Hi,

Is there any way to slow down the speed of the rotation if the 'Play' button is pressed? Thanks.

Filename prefixing request

Hi, Great Plugin! I am looking at switching to this from another 360 plugin for one of my customers websites. The current plugin is experiencing some chrome / webkit issues so we have been searching for an alternative.

We already have around 800 product 360 folders and they are set out in following file format:

img01.jpg,
img02.jpg,
img03.jpg,
..
img09.jpg,
img10.jpg,
img11.jpg,

When applying the file prefix "img". The output filename is img1.jpg (which doesn't exist).

When applying the file prefix "img0" the filename becomes img01.jpg which works for the first 9 frames, however once it reaches frame ten, it outputs, img010.jpg (again, doesn't exist).

I am wondering how feasible it is to add a further option to allow for a leading zero within the first 9 frames as it would be quite time consuming renaming all of the filenames on the server.

Thanks

V2.0.0 docs

Great work getting v2.0.0 ready. Can you close this when you've updated the docs? I'd love to know about all the new stuff in case I miss something.

Show loading pragramatically

I have a list of products that needs to be shown in the slider. When I click on one of the products i change the slider file path and prefix, and re-init again, but the loading doesn't show.

Any way to set a start and end point?

Is it possible to prevent the loop to use the script for animation?
So you have to swipe forward and backward without any loop, but a swipe which ends at the endFrame or startFrame.

3D (vertical rotation)

Bit of an enhancement but would be quite cool, having the ability to also rotate vertically so it can be a completely 3D animation. Not sure of the best implementation/ structure for it though.

Dragging: false, is not working

Why the option dragging : false is not working? Can you help me? Thanks!

window.onload = init;
var product;
function init(){
    product1 = $('.product1').ThreeSixty({
        totalFrames: 52,
        endFrame: 30,
        currentFrame: 1,
        imgList: '.threesixty_images',
        progress: '.spinner',
        imagePath:'img/car/',
        filePrefix: '',
        ext: '.png',
        height: 447,
        width: 1000,
        navigation: true,
        disableSpin: false,
        dragging: false
    });
}

Data transfer mobile friendly click to load option and demo

I made this for my site but I think it would be a nice feature to implement in the slider.

I've got an initial image and 360 icon over it which onclick initializes the slider. It enables you to load a lightweight version of the site on mobile and let users choose if they want to see the 360 view for additional data transfer. The icon has info on how much additional data needs to be loaded. This could be also coded as parameter.

Additionally there could be an option to use only percentage of images on mobile/3G detection like half or third so its more lightweight.

Buggy performance in Android built in browser

I just wanted to say I love your plugin it works great on everything else. In the android built in browser If you drag in small amounts it works okay but if you drag quickly it drops frames and generally bugs out. Part of this is poor memory management on the browser side... if we reduce the size and number of images it works better. There seems to be some issue with the touch input though.. any thoughts?

different animation length in .previous() and .next()

in Version 1.0.1 there seem to be different animation length' in .previous() and .next() method... rolling back to 1.0.0 solved this behaviour. i haven't took a look into the code ;-)

...to reproduce this, you just just need to change the threesixtyslider.js version in your "car-demo" to 1.0.1... .next() and .previous() should be visibly different then.

gotoAndPlay zero frame artefact

Hi.
When I open console on demo with car and I type i. e.:
car.gotoAndPlay(40)
car.gotoAndPlay(17)
... etc.
animation works properly, but 0 frame stay like an artefact in background.

Then, when I just one time set car.gotoAndPlay(0) and then i. e. set car.gotoAndPlay(40), then everything is okay and artefact dissapear.

After page reload, when I firstly type car.gotoAndPlay(0) and the i. e. car.gotoAndPlay(40) also everything is ok and artefact doesn't shown.

I want to use goToAndPlay to build some animation on my page, but this one thing cause it doesn't look good. What can cause that situation or what can I do to fix that?

Sprite Image

Is there any possible way use frames in one sprite instead of many separate pictures?

PNG Images with "disableSpin: true"

Hi,
when using the option "disableSpin: true", the first and the third ol>li>img will always have the class "current-image".

This doesn't matter when using jpg-images, but when using transparent png-images
always a part of the second "current-image" will be visible.

I hope you can help me to fix this.
Achim

Is it possible to destroy the element

Hello. I have a task to rotate my images pack and when I click on a button, the size of pictures have to increase. Unfortunately I didn't find it in the documentation. It's impossible to change the sizes and I can't kill the first object to create another one. Please help me.

Flickering on Internet Explorer

So on IE11 in win 8.1 when you rotate first time after load each image flicker white when first shown. It looks like those aren't pre-rendered on IE. I'm not using the initial spin option but during that spin it also flickers. The repro works in demos.

Changing imagePath "on the fly".

I have one problem on my site. When user clicks on the button, I need to change the animation. All parameters stay the same, I need to change only imagePath.
I found temporary solution - i am hiding one animation block and showing second one.
But probably you can show me better solution of my problem.

Thanks.

[SOLVED] 360 slider loads last - after entire site has loaded

Hi,

First off, this plugin is amazing. Brings a level of simple sophistication to my website.

My issue is that the index page of my website is quite large, and i find that the plugin only appears after my entire website has loaded.

Could someone give hint or direct me to what party of threesixty-slider that dictates load-timing behavior?

Thanks in advance.

gotoAndPlay method spins back to literal frame number rather than denormalized relative frame

If you spin the image set multiple times past the original number of frames and the endFrame gets set to some number higher than the number of frames, when you fire off a gotoAndPlay, the rotator will have an unwinding spin effect to make its way all the way back to the frame entered for the gotoAndPlay. It makes more sense to just jump to the denormalized relative frame. For example, if you have 50 frames and the current endFrame is 240 and the gotoAndPlay frame is 10, it should go to 260 since that is the fastest route to 10.

I have a suggested fix for this as well ( I'm new to github, so please tell me if there is a better way to submit such fixes ):

/**
 * @method gotoAndPlay
 * @public
 * Function animates to previous frame
 *
 */
base.gotoAndPlay = function (n) {
  // Since we could be looped around grab the multiplier
  var multiplier = Math.ceil(AppCongif.endFrame / AppCongif.totalFrames);
  if(multiplier === 0) {
    multiplier = 1;
  }

  // Figure out the quickest path to the requested frame
  var realEndFrame = (multiplier > 1) 
    ? AppCongif.endFrame - ((multiplier - 1) * AppCongif.totalFrames)
    : AppCongif.endFrame;
  var currentFromEnd = AppCongif.totalFrames - realEndFrame;

  // Jump past end if it's faster
  var newEndFrame = 0;
  if(n - realEndFrame > 0) {
    // Faster to move the difference ahead?
    if(n - realEndFrame < realEndFrame + (AppCongif.totalFrames - n)) {
      newEndFrame = AppCongif.endFrame + (n - realEndFrame);
    } else {
      newEndFrame = AppCongif.endFrame - (realEndFrame + (AppCongif.totalFrames - n));
    }
  } else {
      // Faster to move the distance back?
      if(realEndFrame - n < currentFromEnd + n) {
        newEndFrame = AppCongif.endFrame - (realEndFrame - n);
      } else {
        newEndFrame = AppCongif.endFrame + (currentFromEnd + n);
      }
  }

  // Now set the end frame
  if(realEndFrame !== n) {
    AppCongif.endFrame = newEndFrame;
    base.refresh();
  }
}; 

Files dont work

I download zip and upload to my server to see the demos but dont work the page keep on 0%

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.