Jump to content
Search Community

Draggable and 360 obj viewer :)

Diaco test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi guys  :)

 

i'm trying to make 360 object viewer with  TweenMax and Draggable  , but have some problems here ; the viewer has 36 frame and shouldn't have negative numbers and larger than 36 . on drag , how can loop the number of frame if that was >36 and <1 ?!... 

i just want to know how can limit the variable between 1 - 36 .

 

Can anyone help me?

 

i made a codepen , pls check this out :

 

http://codepen.io/anon/pen/jnsjko

 

with best regards and thanks in advance  :D

See the Pen nsjko by anon (@anon) on CodePen

Link to comment
Share on other sites

Hello AncientWarrior, and welcome to the GreenSock Foums!

 

If you take a look at this Topic Animate a large sequence of png's ... you can see how they talk about creating a image sequence slider triggered by draggable using GSAP.

 

Also here is a sweet codepen example by jamiejefferson that does just that:

 

See the Pen IeLGB by jamiejefferson (@jamiejefferson) on CodePen

 

Hope this helps? :)

  • Like 1
Link to comment
Share on other sites

Hi jonathan

thanks for your replay 

 

i already saw these examples and tried to go another way , in the examples he changed background css position or all pictures loaded in dom ,  and i want to use variable as image name ( myImg.src= "360/s"+movie.frame+".jpg" )

 

i just want to know how can limit the variable between 1 - 36 .

 

anyway thanks again for your replay :)

Link to comment
Share on other sites

hi again jonathan  :)

 

i just want to know how can limit the variable between 1 - 36 and have loop between these num.

i want to use variable as image name ( myImg.src= "360/s"+movie.frame+".jpg" ) , 

dont want to have these numbers : Negative numbers , 0 , >36 for my variable

 

but can`t figure out how  :(

Link to comment
Share on other sites

To check if the movie.frame is between 0 and 36 .. then you could try this:

// check if movie.frame is less than or equal to 36
// and if movie.frame is greater than or equal to 0
if ( movie.frame <= 36 && movie.frame >= 0 ){

}

But I'm a still a little confused on what your example is trying to do:

  • Are you trying to make this stay within range 0-36 while dragging?  ..
  • or make this stay within range 0-36 when it automatically plays? ..

:)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...