[wp-hackers] Start of new themes page

Brad Fults bfults at gmail.com
Sat Jun 4 21:12:20 GMT 2005


After a very quick cursory review, the most notable needed change is
your setInterval() call. You should pass it a function reference as
the first parameter, which can be easily achieved using a closure.

Passing it a string is an old an undesired method and is a performance
concern due to the need for re-compilation of the code at runtime
(akin to the horrors of eval()).

So, change:

ss_INTERVAL = setInterval('ss_scrollWindow('+ss_stepsize+','+destx+',"'+anchor+'")',10);

to:

function getFnScrollRef(ss, dx, a) { return function() {
ss_scrollWindow(ss, dx, a); }; }
ss_INTERVAL = setInterval(getFnScrollRef(ss_stepsize, destx, anchor),10);

If I have more time later I can provide a more thorough review as well
as Safari testing.

-- 
Brad Fults
NeatBox

On 6/4/05, David House <dmhouse at gmail.com> wrote:
> On 6/4/05, David House <dmhouse at gmail.com> wrote:
> > Okay, this has been developed now. There's three more functions that
> > need to be added to the theme-scroll.js file. I actually made some
> > other ammendments to highlightLink() to increase performance, so it
> > would be easiest to just replace the entire theme-scroll.js file with
> > the one I've attached.
> 
> Let's attach it this time.
> 
> --
> -David House, dmhouse at gmail.com, http://xmouse.ithium.net
> 
> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 
> 
> 
>


More information about the wp-hackers mailing list