← Back to team overview

jessyink-team team mailing list archive

Re: updated the keyboard branch...

 

Hey Haness,

I'm sure you're right as counter is only really used in mouseover and that
would save one function call. Out of interest though, how would you work out
which slide "this" is without the counter attribute? At the moment, all I
have to do is:

counter = parseInt(this.getAttribute("counter"));

however without counter, I was pretty much stuck. Any idea?

Cheers,
Egor

On Wed, Jul 1, 2009 at 9:51 PM, Hannes Hochreiner <hannes@xxxxxxxxxxxxxx>wrote:

> Hi Egor,
>
> >         There was one thing I wanted to ask you: I saw that you
> >         preferred to
> >         used a counter attribute and a separate onmouseover function
> >         instead of
> >         assigning the event handler directly to the slide. I was
> >         wondering why
> >         that was.
> >
> > I'm glad you asked... in my mind, they are both linked :-)
> >
> > One thing I noticed when I started playing with the jessyink code was
> > that there were a few unnecessary redraws. In index mode for instance,
> > the index got redrawn every time a slide was moved. This is not
> > necessary if the top left slide isn't changed (the active slide is
> > moved within the same page). Same with moving the mouse, only redraw a
> > slide if the mouse moves out of the boundaries of a slide... (new
> > activeslide) and also in that case, the index doesn't need redrawing.
> >
> > So in terms of code: in mouseover, we have:
> >
> >     if (currentMode == SLIDE_MODE)
> >     {
> >         return;
> >     }
> >
> > ^^^^^ by the way, because of this, there might be a good reason to try
> > and combine mouseover and mousemove...
> >
> > and more importantly:
> >
> >     var counter = parseInt(this.getAttribute("counter"));
> >
> >     if (activeSlide == counter)
> >         return;
> >     indexSetActiveSlide(counter);
> >
> > which is the bit that you don't have in your test... and the reason
> > why I need the counter attribute. Wasn't sure how to do this any other
> > way I'm afraid...
>
> Thanks for the explanation. I think we could put the additional test
> into the event handler directly, which would save the number parsing.
>
> > Oh, and on a slow machine, there's a noticeable increase in
> > responsiveness when moving the mouse about in index mode... I hope I'm
> > not imagining things though!
>
> I very much appreciate that since I work on a slower machine :-)
>
> Cheers,
> Hannes
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~jessyink-team<https://launchpad.net/%7Ejessyink-team>
> Post to     : jessyink-team@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~jessyink-team<https://launchpad.net/%7Ejessyink-team>
> More help   : https://help.launchpad.net/ListHelp
>

Follow ups

References