← Back to team overview

jessyink-team team mailing list archive

Re: updated the keyboard branch...

 

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





Follow ups

References