jessyink-team team mailing list archive
-
jessyink-team team
-
Mailing list archive
-
Message #00038
Re: updated the keyboard branch...
Hi Hannes,
> Keyboard branch now synced with Trunk. No addition to this branch will
> > be made, just code updates where necessary. Purpose of this branch
> > achieved!
>
> Cool! Thanks a lot! I'll merge the branch back into the trunk then
> (should be a breeze as you synced it already).
I fixed a few more things this morning, so the branch should be pretty clean
now. I reshuffled a few of the functions around to keep the mouse functions
grouped together but other than that, Marc's code from trunk is pretty much
the same as it was before.
>
> 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...
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!
If there's anything wrong with my logic or an easier way to do this, please
do tell me, javascript is not my strongest language!
Cheers,
Egor
Follow ups
References