Monday, July 20, 2009

Brief display of unformatted text while jquery-ui or yui loads

On our new site I was seeing ugly unformatted text for a second while the jquery or yui widget loads. I didn't find anything about how to deal with that, but Michael of Amptools showed me the light.

1. Add style="display: none" to the element. Not in the stylesheet.

2. In the js for the dom event watcher, after the element loads, make it visible, like so:

(function () {
var carousel = null;
setTimeout(function() {

YAHOO.util.Event.onDOMReady(function (ev) {
var carousel =
new YAHOO.widget.Carousel("carousel-element",{
animation: { speed: 1 }
});

carousel.set("numVisible", 4); // override the default
carousel.set("revealAmount", 0);

carousel.render(); // get ready for rendering the widget
carousel.show(); // display the widget
jQuery("#carousel-element").slideDown();
});
},25);
// timeout is necessary for Safari and Chrome.
// Can be increased.
})();

Eclipse crashing when typing $

Eclipse 3.5 has been hanging almost every time I type a "$" character... and that's quite often. Every time this happened I had to force-quite on my Mac. At least PDT fixed that ridiculous "Selection Job Titile" error with this release.

Michael of Amptools kindly posted this bug to the Eclipse project, too. In the meantime I reverted to writing code in TextMate, no hardship there, but no "intellisense" treats either.

After uninstalling, reinstalling, and much gnashing of teeth, I did some more searching and pondering about this error.

This post gave me the clue I needed to deal with this problem.

The problem is solved by changing the Auto Activation code assist to a longer delay.

Preferences->PHP->Editor->Code Assist->Auto Activation

I'm finding that increasing the auto activation from 200 to 1000 is solving the hangs.

Yay!