Ugh..

(function( $ ){

  var last = 0,
    $pane = $('#container'),
    $items = $pane.find('li');

  $('#next').bind('click', +1, handler );
  $('#prev').bind('click', -1, handler );

  function handler( e ){
    var next = last + e.data;
    if( $items[next] ){
      last = next;
      $pane.scrollTo( $items[next], ... );//check the settings
    }
  };

})( jQuery );

Ariel Flesler

On 29 ene, 22:15, Ariel Flesler <[EMAIL PROTECTED]> wrote:
> Hi caruso, your situation remainds me of 
> this:http://www.freewebs.com/flesler/jQuery.ScrollShow/
> It's a plugin that actually uses ScrollTo. It's called 
> ScrollShow:http://plugins.jquery.com/project/ScrollShow
>
> I kinda abandoned the plugin and it stayed in beta stage, but it
> automatically does what you are saying.
> If you use it, set the setting 'navigationMode' to 's' instead of
> 'sr', to release the click on the items, also set 'wrappers' to '',
> you don't need that.
> It can also be done with a small snippet that remembers the last,
> something like:
>
> (function( $ ){
> &nbsp;&nbsp;var last = 0,
> &nbsp;&nbsp;&nbsp;&nbsp;$pane = $('#container'),
> &nbsp;&nbsp;&nbsp;&nbsp;$items = $pane.find('li');
>
> &nbsp;&nbsp;$('#next').bind('click', +1, handler );
> &nbsp;&nbsp;$('#prev').bind('click', -1, handler );
>
> &nbsp;&nbsp;function handler( e ){
> &nbsp;&nbsp;&nbsp;&nbsp;var next = last + e.data;
> &nbsp;&nbsp;&nbsp;&nbsp;if( $items[next] ){
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;last = next;
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> $pane.scrollTo( $items[next], ... );//check the settings
> &nbsp;&nbsp;&nbsp;&nbsp;}
> &nbsp;&nbsp;};
>
> })( jQuery );
>
> I checked the syntax was correct, but not that it works, I hope it
> does :)
> Thanks for you reply.
>
> Cheers
> Ariel Flesler
>
> As for adding that to LocalScroll... that plugins handles anchor, this
> is different. Maybe ScrollShow is the solution.
> On 29 ene, 18:57, caruso_g <[EMAIL PROTECTED]> wrote:
>
>
>
> > Thanks Ariel, I didn't be able to use it for the following project
> > (http://www.bonsai-studio.net/clients/lamoy/wessel02/albums/page2/inde...
> > ) so I had to make some code to the ground up (think about I am just a
> > designer... :P ).
>
> > So here I am, I have a feature request!
>
> > Can you implement a function to just use two links ("left | right" in
> > the example above) to make the content scroll to the previous or the
> > next item into the container?
> > It would be great!
>
> > I imagine the code I wrote should be horrible to your eyes, but that
> > should make the idea of the feature I am talking about.
> > It would be great if at the end of the items it could show again the
> > first item, like  Coda website, and so on.
>
> > Thanks in advace.
>
> > On Jan 29, 6:08 pm, Ariel Flesler <[EMAIL PROTECTED]> wrote:
>
> > > Hi all
>
> > > Thanks a lot for your replies!
>
> > > @Jack
> > >     I don't fully understand what you mean, could you explain it some
> > > more ? or maybe find an example (can be flash or anything).
>
> > > @caruso
> > >    ScrollTo can scroll to any kind of element, not only LIs. Check the
> > > old demo, the first input field uses a CSS class based selector, with
> > > an :eq  filter. You can use any kind of selector, but you must make
> > > sure it matches at least 1 DOM element. The first one will be taken
> > > into account.
>
> > > @Alexandre
> > >    I really liked your comment, I also loved the psychodelic squares,
> > > but I realized the demo wasn't very useful in the end. So I started
> > > over.
>
> > > Thanks again, I'm open to new features for any of both plugins. Just
> > > beware not to go far away from the scope of the plugin.
> > > Cheers.
>
> > > Ariel Flesler
>
> > > On 29 ene, 14:48, "Alexandre Plennevaux" <[EMAIL PROTECTED]> wrote:
>
> > > > in fact i just looked at the old demo and i find it quite nice looking 
> > > > too!
> > > > (me love colours :)
> > > > at least it's not webtwooish, which is a quality in my eyes 
> > > > :)http://www.freewebs.com/flesler/jQuery.ScrollTo/index.old.html
>
> > > > On Jan 29, 2008 4:56 PM, caruso_g <[EMAIL PROTECTED]> wrote:
>
> > > > > Hi, thanks a lot for these great plugins. They are awesome.
> > > > > But I would make you a feature request, if possible, and, when you
> > > > > can.
>
> > > > > It would be great to be able to scroll to any kind of elements into
> > > > > the containner, and not only list items.
>
> > > > > Sometimes it happens that one can't know in advance which kind of
> > > > > elements will be putted by the client into the container, so allowing
> > > > > to scroll to "anything" inside it would solve a lot of problems!
>
> > > > > Thanks lot anyway for your great works, and I would like to thanks all
> > > > > other developers out there for your wonderful work and your friendly
> > > > > support.
>
> > > > > On Jan 29, 3:54 am, Jack Killpatrick <[EMAIL PROTECTED]> wrote:
> > > > > > Thanks for the additional demos, they opened my eyes to a few usages
> > > > > > that I hadn't thought of when looking at the axis-based demos. Very
> > > > > nice.
>
> > > > > > I'm wondering: could this be adapted to do "velocity based" (for 
> > > > > > lack of
> > > > > > a better word) scrolling, like the iphone and ipod touch do? I'm
> > > > > > thinking something like
>
> > > > > > a) the user would click on div (which might have a list in it), then
> > > > > > flick their mouse (or pen, for us pen-tablet users)
> > > > > > b) a distance somewhere else on the div would be calculated based 
> > > > > > on the
> > > > > > speed of the flick
> > > > > > c) the scroller would use one of the easing plugins (or some other
> > > > > > animation) to scroll to/near the calculated destination
> > > > > > d) clicking on them while they're moving would stop them where they 
> > > > > > get
> > > > > > clicked.
>
> > > > > > Any plans for that? Thoughts? I'm picturing little "flick lists" 
> > > > > > that
> > > > > > could be embedded in a page.
>
> > > > > > Thx,
> > > > > > Jack
>
> > > > > > Ariel Flesler wrote:
> > > > > > > Hi everyone
>
> > > > > > > Right before going on vacations, I improved the demos of both 
> > > > > > > ScrollTo
> > > > > > > and LocalScroll. I Applied a common style to all of them. And
> > > > > > > simplified the code of LocalScroll's to make it work entirely 
> > > > > > > with the
> > > > > > > plugin (no "raw" call to ScrollTo).
> > > > > > > I also added an AJAX version of the LocalScroll's demo, showing 
> > > > > > > the
> > > > > > > use of the option 'persistent', which is IMO, quite useful.
>
> > > > > > > In short.. if someone's interested in checking.. here are the 
> > > > > > > links:
> > > > > > > LocalScroll:http://www.freewebs.com/flesler/jQuery.LocalScroll/
> > > > > > > LocalScroll AJAX version:
> > > > >http://www.freewebs.com/flesler/jQuery.LocalScroll/ajax/
> > > > > > > ScrollTo:http://www.freewebs.com/flesler/jQuery.ScrollTo/
>
> > > > > > > Cheers.
> > > > > > > Ariel Flesler
>
> > > > --
> > > > Alexandre Plennevaux
> > > > LAb[au]
>
> > > >http://www.lab-au.com-Ocultartextode la cita -
>
> > > > - Mostrar texto de la cita -- Ocultar texto de la cita -
>
> > - Mostrar texto de la cita -- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -

Reply via email to