Listing 2: effects.js Some fun JScript functions
var timeoutId; function animate() { if (oBrowser.Left > 100) { oBrowser.Left -= 30; with (oBrowser.Document.parentWindow) { setTimeout(animate, 100); } } } function jitter() { oBrowser.Visible = true; with (oBrowser) { x = Left + 2 * (Math.random() - 0.5) * 10; y = Top + 2 * (Math.random() - 0.5) * 10; Left = x; Top = y; // A document must be loaded into the browser, // or setTimeout() will throw an exception with (oBrowser.Document.parentWindow) { timeoutId = setTimeout(jitter, 500); } } } function stopJitter() { oBrowser.Document.parentWindow.clearTimeout(timeoutId); }