Fx.Drag

here you can Request certain custom made Scripts in exchange for something (most likely money)

Moderator: 1.2 Moderators

Fx.Drag

Postby dreadcast on Wed Dec 16, 2009 1:59 pm

Hi all,
I've found this script on the web : http://codecanyon.net/item/smooth-scrol ... view/70644
I'd like to create such a script, which could smoothly scroll or drag elements, mootools-style (which could be called Fx.Drag or Drag.Smooth...), but I'm way too bad at maths !


So I've mixed Drag and Fx.Scroll in a function :

  1.  
  2. var contentFx = new Fx.Scroll(element, {
  3.     transition: Fx.Transitions.Bounce.easeOut,
  4.     duration: 1000
  5. });
  6. var drag = new Drag(element, {
  7.     modifiers: {x: 'scrollLeft', y: 'scrollTop'},
  8.     invert: true,
  9.     style: false,
  10.     onStart: function(element, event){
  11.         start = {
  12.             y: event.page.y,
  13.             x: event.page.x
  14.         }
  15.     },
  16.     onComplete: function(element, event){
  17.         contentFx.start(
  18.             element.getScroll().x + start.x - event.page.x,
  19.             element.getScroll().y + start.y - event.page.y
  20.         );
  21.     }
  22. });
  23.  


The effect is there, but not smooth, right ?

Has anyone seen this or planned developing such a script ?

so long
Last edited by dreadcast on Thu Jan 07, 2010 1:50 pm, edited 1 time in total.
dreadcast
 
Posts: 6
Joined: Wed Dec 16, 2009 1:41 pm

Re: Fx.Drag

Postby dreadcast on Thu Jan 07, 2010 1:43 pm

I found this : http://mootools.net/forge/p/drag_flick

It can be improved of course, but that's what I was looking for !
dreadcast
 
Posts: 6
Joined: Wed Dec 16, 2009 1:41 pm


Return to Script Request

Who is online

Users browsing this forum: No registered users and 1 guest