Any ideas? THANKS
On Sep 21, 12:47 pm, Macsig <sigbac...@gmail.com> wrote: > Thanks, > it stops the animation but now there is an other issue. > Is there a way to keep the same speed for thescrolling? I mean if I > set the duration up and down and I go down just, let us say, for 1/3 > of the div when I scroll back up the animation is 3 times slower since > the duration is hardcoded. > The first idea I had is to determine where I'm in the div in order to > define a constant speed but I can find anything about that on scrollTo > documentation. > For instance, let us say I want to have 5000 as a duration for the > entirescrolling, when I'm 20% down I want to set the up speed = > 5000x0.2 and down speed =5000x0.8. In this way the speed is constant. > > THANKS > > On Sep 21, 8:01 am, Robin Abony <robin.ab...@gmail.com> wrote: > > > > > Hello macsig! > > > I haven't really had time to look into your problem, but after a quick > > look through the documentation i found > > thishttp://docs.jquery.com/Effects/stop#clearQueuegotoEnd > > > Perhaps that could work for you? I imagine something along the lines > > of : > > > $('#down_button').mouseover(function(){ > > $('#text').scrollTo('100%', {axis:'y', > > duration: 5000}); > > }).mouseout(function(){ > > $('#text').stop(); > > }); > > > Give that a try! > > > On 21 Sep, 03:49, macsig <sigbac...@gmail.com> wrote: > > > > Hi there, > > > I'm trying to use scrollTo in oder to scroll vertically a div. I want > > > to use 2 anchors, one to go up and the other to go down and I need > > > that the effect works ONLY when the mouse is over the anchor (when I > > > move it out the animation has to stop). > > > > How can I achieve so? > > > > For instance the code below scrolls correctly down but it doesn't stop > > > until the end even if I move out the mouse. > > > > $('#down_button').mouseover(function(){ > > > $('#text').scrollTo('100%', {axis:'y', > > > duration: 5000}); > > > }).mouseout(function(){ }); > > > > THANKS > > > > Sig