List Info

Thread: Getting behaviour to run incrementally?




Getting behaviour to run incrementally?
user name
2006-03-18 21:25:45
As it's currently implemented, Behaviour is run onLoad.
Unfortunately,
this means that none of the Behaviours are in place while
the page is
loading, even though the browser renders the page
incrementally.

For example, if you have a Behaviour function that changes
the look of
an element then the elements will first appear with the old
look and
then, when the page finishes loading, they'll all change.
Needless to
say, this is pretty annoying.

Does anyone know how to change this so that Behaviour gets
called
_before_ the elements appear on the screen?

Sprinkling the page with
<script>Behaviour.apply()</script> tags seems
to work, but is annoying and seems to defeat the whole
purpose of
cleaning up the page.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Behaviour Javascript Library"
group.
To post to this group, send email to behaviourgooglegroups.com
To unsubscribe from this group, send email to
behaviour-unsubscribegooglegroups.com
For more options, visit this group at http://group
s.google.com/group/behaviour
-~----------~----~----~----~------~----~------~--~---

Getting behaviour to run incrementally?
user name
2006-03-19 23:08:41
How about a short script like this:

timeoutId = null;

function applyTillLoaded() {
  Behaviour.apply();
  timeoutId = setTimeout("applyTillLoaded",
500);  // milliseconds
}

window.onload = function () {
  clearTimeout(timeoutId);
}

applyTillLoaded();


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Behaviour Javascript Library"
group.
To post to this group, send email to behaviourgooglegroups.com
To unsubscribe from this group, send email to
behaviour-unsubscribegooglegroups.com
For more options, visit this group at http://group
s.google.com/group/behaviour
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )