Jump to content
Search Community

Advice on a responsive layout using draggable

ochalmers 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 all,

 

I'm setting up a video gallery for a new project and am harnessing the power of the magnificent draggable plugin. The problem i'm currently facing is how to adapt the layout for various screen sizes. Currently the draggable functions are fired on screen sizes over 700 pixels (all messily contained within an if statement) and the layout is changed via css to adapt when below that pixel size. What i'd love to do is change the draggable functions and dependencies on sizes below 700 px to function vertically instead of the current horizontal layout. The if statement / CSS media query option seems so ugly at the moment.

 

Also - I didn't want to include the throwprops plugin as it's members only - do we have a common source for this to be used on codepen?

 

Cheers!
 

See the Pen OyLEem by olichalmers (@olichalmers) on CodePen

Link to comment
Share on other sites

Hi,

 

I'm not sure what events and function you're talking about. There are none in your Draggable instance, except for the snap function and I see everything working OK in small screens.

 

Please set up a sample that clearly shows the events you're having problems with.

 

For using the ThrowProps plugin in codepen, here's the link:

 

http://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/ThrowPropsPlugin.min.js

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